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

[REBOL] Re: Parsing comment

From: joel:neely:fedex at: 26-Sep-2002 13:14

Hi, Gregg, et al, Yet another variation, just for fun, and a profound philosophical comment... ;-) Gregg Irwin wrote:
> Hi Dick, > > Hopefully I won't just add more confusion here... > > << 10 + 10 > means something to the Rebol interpretation process, but > 10+10 does not have the same meaning... > > If we take the numbers out of the equation :) to avoid > syntactical issues, you can do this (because + is a valid > character in words): > > >> a: 1 > == 1 > >> b: 2 > == 2 > >> a + b > == 3 > >> a+b: 4 > == 4 > >> a+b > == 4 > > So, "a+b" is not the same as "a + b". Now, you could also > change the operation of +, like this: > > >> set '+ :* > >> 1 + 3 > == 3 > > But, AFAIK, you can't alter the operands that an operator > operates upon. :) >
Depends on your definition of "alter"...
>> a: func [:op 'val] [set val do [op get val get val]] >> b: 3
== 3
>> a + b
== 6
>> b
== 6
>>
A long time ago I heard someone say "FORTH is not a programming language; it is a programming language construction kit!" Despite differences in notation and internal representation, the REBOL facility for dailecting, and the absence of distinction between "data" and "code" make me think that the same statement could be made of REBOL. Of course, I remember the saying, I've only met one self-made man, and he should have sued the manufacturer for malpractice! ;-) -jn-