[REBOL] Re: Slashdot REBOL mention
From: rotenca:telvia:it at: 31-Oct-2001 16:33
> Example #2 Rebol PARSE function. Let's have a block:
>
> block: [copy result telephone]
>
> If we simply DO this block, we are evaluating the COPY function that should
> set 'result to refer to a copy of TELEPHONE. If we instead use block as a
> parse rule, BLOCK would have totally different meaning. Namely, 'result
> would be set to a copy of a part of PARSE INPUT argument that would satisfy
> the TELEPHONE subrule. The difference isn't that big, but it is only
> natural, that 'copy should always communicate similar meaning, isn't it?
>
> There is a whole lot of native Rebol dialects, examples:
I like to think that:
[copy result telephone]
has no meaning before the program give it one. There are not keywords (words
with fixed meanings).
Before DO-ing it, you must give a meaning to the words of that block, binding
them to a context.
Everything is a dialect in Rebol.
> The existence of dialects doesn't distinguish these languages. The real
> difference is, that we can define our own REBOL dialects (using PARSE e.g.),
Parse can be util to change the syntax, like in the parse dialect itself,
where set-word and get-word have a different use, but context is the key for
meaning:
x: [copy result telephone]
bind x in context [copy: :+ result: 3 telephone: 5] 'self
; now the words in x have others meanings until we re-bind them
do x
bind x in context [copy: :view result: :layout telephone: [button ""]] 'self
do x
> A "buzzword" that communicates this meaning is, that REBOL is a language
> with meta-circular semantics. This feature makes the language much more
> communicative than any other language not having this feature is.
Semantic -> bind, parse cannot directly change the meaning of a word.
Fixed, in Rebol, are only some syntax rules: the use of "[]", of "()", strings
{}, set-word, get-word, comment ; and little more. Datatypes are almost
fixed (to-word is not datatype aware) but only because RT did not give us the
mode to change the load function to change/add/remove some datatypes.
> Ladislav
---
Ciao
Romano