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

[REBOL] Re: defining words ==> was:{Re: Teaching Rebol => was:{Re: Re: Parsing c

From: al:bri:xtra at: 27-Sep-2002 10:59

Laurent wrote:
> This has nothing to do with the previous subject but I am very interested
in knowing how this is useful to you, could you explain it a bit ? Perhaps a more useful example:
>> do ask "Please enter an example script: "
Please enter an example script: set 'Foo "Hello!" print Foo Hello!
>> foo
== "Hello!" Which is a primitive Rebol console written in Rebol. Here's another more useful example, for a database using Rebol block! values to hold name values pairs.
>> X: [ ; Only one record.
[ Name "Andrew" [ Email [Al--Bri--NoSpam--xtra--co--nz] [ ] == [ Name "Andrew" Email [Al--Bri--NoSpam--xtra--co--nz] ]
>> foreach [Name Value] X [set Name Value]
== [Al--Bri--NoSpam--xtra--co--nz]
>> Name
== "Andrew"
>> Email
== [Al--Bri--NoSpam--xtra--co--nz] Usually the 'foreach would be 'do-ne inside a object! which is the context for all words stored in the database. That object is the prototype for the stored records. Andrew Martin ICQ: 26227169