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

[REBOL] Re: Looking for advice

From: g:santilli:tiscalinet:it at: 18-Jan-2003 21:05

Hi Pat, On Saturday, January 18, 2003, 6:39:03 PM, you wrote:
> [3 none 1 + 9 4 + 1 -] -> [3 + 9 + 1] > [0 4 0 + 0 none none 2 /] -> [0 + 0] > [none / 8 1 7 none 0 * 5] -> [8] > [7 1 9 3 4 9 none - none] -> [7] > [2 3 - 7 + none 0 / none] -> [2 - 7 + 0]
Quick and dirty example: rule: [ to number! set ln skip (emit ln) any [ to word! ['none | set op skip to number! set rn skip (emit op emit rn)] ] ] emit: func [val] [insert tail out :val] out: [] test: func [block] [clear out parse block rule out]
>> test [3 none 1 + 9 4 + 1 -]
== [3 + 9 + 1]
>> test [0 4 0 + 0 none none 2 /]
== [0 + 0]
>> test [none / 8 1 7 none 0 * 5]
== [8 * 5]
>> test [7 1 9 3 4 9 none - none]
== [7]
>> test [2 3 - 7 + none 0 / none]
== [2 - 7 + 0] (Notice that the third is different from what you wanted...) Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r