Compose/RealDeep
[1/4] from: info::id-net::ch at: 1-Dec-2002 13:42
Hello,
I composed a function that produces a block. This block is a the WITH of a
Area. I added a 'my-block path to the area' face. (---> face/self/my-block)
The my-block must keep the number of the line where the Area is located on
the layout.
The problem is that i cant compose/deep to make the "NoLine" reduced. I
tried to use "reduce compose/deep", "compose/deep" or compose but in the
different cases, either something else is changed (the 'engage function
actually, producing an error), or the noLine is not reduced.
I tried to compose it separated, too : Compose a part of those blocks
besides. Nothing works.... Someone got an idea ?
Philippe Oehler
do-addArea: func [noLine [integer!]]
[ addArea:
[
[
compteurA: 0
feel: make feel
[
engage: func [face act event nodeligne] compose
[
(copy second get in ctx-text/edit 'engage)
if system/view/focal-face = face/self
[
face/self/my-counter: face/self/my-counter + 1
if face/self/my-counter = 1
[
face/self/user-data: copy face/self/text
face/self/my-block: noLine
]
either (face/self/user-data = face/self/text)
[print "same"][print "change"]
print face/self/my-block: noLine
]
]
]
]]
;print mold ajoutArea halt
]
[2/4] from: anton:lexicon at: 2-Dec-2002 1:07
What exactly are you trying to do?
Why are you doing this?
You want to produce a new style of
area that does ... what?
Anton.
[3/4] from: info:id-net:ch at: 1-Dec-2002 16:11
I want to create a new style of area that keep some extra-data within its
structures.
[4/4] from: lmecir:mbox:vol:cz at: 1-Dec-2002 21:11
Hi Philippe,
I must say, that I don't know, what you are trying to achieve. First of all,
I would suggest you to post the code respecting Rebol style guide, because
that enables others to use cut and paste method.
I wrote a version of your code, that produces equal result as your original
function does, with exactly one exception - noLine is replaced by the
number.
HTH
-L
do-addArea: func [noLine [integer!]] [
addArea: compose/deep [
[
compteurA: 0
feel: make feel [
engage: func [face act event nodeligne] compose [
(first [(copy second get in ctx-text/edit 'engage)])
if system/view/focal-face = face/self [
face/self/my-counter: face/self/my-counter + 1
if face/self/my-counter = 1 [
face/self/user-data: copy face/self/text
face/self/my-block: noLine
]
either (first [(face/self/user-data face/self/text)]) [
print "same"
][print "change"]
print face/self/my-block: (noLine)
]
]
]
]
]
;print mold ajoutArea halt
]