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

The ideal set-word!, get-word!, path! and url! values

 [1/1] from: al::bri::xtra::co::nz at: 19-Aug-2002 17:19


I'd like to see set-word! values require at least one white-space character after the colon. Like this 'parse rule fragment: Set-Word: [Word #":" some White-Space] Where "Word" refers to the rule for the Word rule. Naturally, the reverse should apply for Get-Word values, in this 'parse rule fragment: Get-Word: [some White-Space #":" Word] If Rebol 'loaded script and used 'parse like:
>> parse "x: :print b: test/:i: 4 [ foo bar ]" ""
== ["x:" ":print" "b:" "test/:i:" "4" "[" "foo" "bar" "]"] Then the whitespace is automatically eliminated, and so can be eliminated from the rules, giving these rules: Set-Word: [Word #":"] Get-Word: [#":" Word] Then the path and set-path rule could be like this: Path: [Word some [#"/" [Get-Word | Word]]] Set-Path: [Path #":"] Just some thoughts. Andrew Martin ICQ: 26227169 http://valley.150m.com/