Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

'compose on 'parse rules

 [1/4] from: al::bri::xtra::co::nz at: 14-Jan-2002 13:22


The most annoying problem with Rebol at the moment, is that 'compose on 'parse rule actions, composes the action parts of the rules. It's quite tricky arranging script to avoid this problem. I use some thing like: compose/deep [ ( make paren! [ ; rule action stuff in here. ] ) ] Any one got any better ideas? Andrew Martin ICQ: 26227169 http://valley.150m.com/

 [2/4] from: rotenca:telvia:it at: 14-Jan-2002 2:30


Hi Andrew,
> The most annoying problem with Rebol at the moment, is that 'compose on > 'parse rule actions, composes the action parts of the rules. It's quite
<<quoted lines omitted: 7>>
> ] > Any one got any better ideas?
Good trick. If you do not need compose/deep: compose [thru (var) [(print "found")]] or: reduce ['thru var [(print "found")]] To put paren in block is a little slower but fix a strange bug in parse when other rules follows the paren! But I have the impression that not always to use or not to use the block around the paren! gives the same result (bug excluded). --- Ciao Romano

 [3/4] from: brett:codeconscious at: 14-Jan-2002 18:32


> Any one got any better ideas?
Nope. But I can shift the problem a little. It may or may not make sense for your script but if you give the action a name then you don't need the parens:
>> my-action: [(print "i'm here!")]
== [(print "i'm here!")]
>> parse [ x ] compose [(to-word "word!") my-action]
i'm here! == true Brett.

 [4/4] from: al:bri:xtra at: 14-Jan-2002 21:17


Brett wrote:
> It may or may not make sense for your script but if you give the action a
name then you don't need the parens:
> >> my-action: [(print "i'm here!")] > == [(print "i'm here!")] > >> parse [ x ] compose [(to-word "word!") my-action] > i'm here! > == true
That's a very sensible idea, Brett. Thanks! Andrew Martin ICQ: 26227169 http://valley.150m.com/

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted