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

[REBOL] Looking for advice

From: patrick::philipot::laposte::net at: 18-Jan-2003 18:39

Hi List, I am faced to a problem for which I cannot found a simple answer, or better said for which any solution I came with seemed "montruously" difficult. I am looking for advice. Here is my problem. I have to evaluate a block like this one [6 + 5 * 4 / 2 + 1]. It is quite simple when the block is well formed [digit operator digit operator ...]. However my block is generated at random whith misplaced items and none values, that have to be discarded like that : [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] I thought 'parse could be used somewhere, but I am not able to figure out how. Regards Patrick