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

[REBOL] Re: lisp-like backquotes macros

From: henri:morlaye:gmai:l at: 26-Nov-2005 13:19

> Probably Ladislav's BUILD will help; anyway, sometimes it is > possible to refactor your code so that you don't need it. > > In the case above, for example, you could write: > > compose [(value1) to-string 2 + (to-integer value2)] > > (Well, actually, in this specific case you could just write: > > reduce [value1 to-string 2 + to-integer value2] > > because there's no reason to do the add and the string conversion > at "runtime", but I assume it's just because this is a simplified > example.)
I don't want it to be done at runtilme. The value is in fact the name of a variable, I create a standard block for a standard function, and then I create several functions using different variables by replicating/compositing the standard block.
> Also, REBOL offers another way to obtain the same goal without > composing at all. > > use [value1' value2'] [ > value1': value1 > value2': to-integer value2 > [value1' to-string value2' + 2] > ] > Using a function like my LOCALIZE in: > > http://www.colellachiara.com/soft/Libs/utility.r > > localize [value1 value2] [ > [value1 to-string 2 + to-integer value2] > ] > > The solutions here do not solve all the cases, especially when you > are composing PARSE rules; but they can give you ideas. >
Thank you very much, utility.r and build.r are nice, I will probably find a solution with them, nevertheless they all seem like workarounds for the lack of backquotes macros, I still don't understand why RebolTech decided to use parens for compose. The lispy method seems so much more comfortable, and more accurate with the use of "-" only when needed instead of the "/only". -- henri