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

[REBOL] functional replace function?

From: bry:itnisk at: 1-Nov-2002 10:53

I suppose this is possible but my Rebol is not good enough yet to see the solution, (I say suppose because I am also worried that my mode of thinking about the problem is colored by other languages) I want to have two blocks, one block contains values to replace in a string, the other block contains values that will be replaced These values should be accessed from a function which I run against the string. The string comes out the other end with values replaced. This seems to me to be the smarter(more functional) structure, unfortunately can't quite see my way to implementing it. The dumber structure, which I can see but don't want to do cause it seems dumber, Would be to iterate through the block of values to be replaced, with each iteration get the answering index number from the block of values that shall do the replacing and then run it against the string replace/all string val1 val2 block1: next block1 any suggested readings, links?