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

[REBOL] Re: The truth about scope

From: gabriele:colellachiara at: 13-Apr-2005 16:14

Hi Michael, On Wednesday, April 13, 2005, 1:36:19 PM, you wrote:
>> the same value. (Almost, there's a detail I'm not going to reveal >> here, for the sake of simplicity.)
MB> So what's the detail ? :-) You could reveal it in the answer to this post. MB> :-) You want to know too much. ;) I'll give you a hint: position. (So now you have a puzzle to solve. ;) MB> Your answer is in some part what I tried to criticize a bit. For the MB> newcomer to Rebol, RT tries to give the impression it's just a normal MB> language --- but way more powerful ---- but the there is never a concise MB> description of what it is supposed to be that is more powerful (execpt MB> statements like dialecting and such). I agree, we need more docs. How many times did I write "we need more docs" in the past years? I guess a LOT. :) MB> And if Rebol is that much MB> easier there should be made an attempt at the beginning to explain this to MB> the people. Simpler, not easier. It has been suggested that "agile" or elegant may be better words. It turns out, indeed, that simpler almost always means more difficult. MB> So is my model correct in this regard ? It is. Everything is data, the function body block is data too. Another example that may clarify it more:
>> b: [bla: []]
== [bla: []]
>> b2: second b
== []
>> insert b2 "hello"
== []
>> b
== [bla: ["hello"]] This doesn't surprise you, does it?
>> f: func [] [bla: []] >> b2: second second :f
== []
>> insert b2 "hello"
== []
>> source f
f: func [][bla: ["hello"]] This is basically the same as above, so if you are surprised just stop thinking about it for a second. :)
>> f: func [x] [bla: [] append bla x] >> f "hello"
== ["hello"]
>> source f
f: func [x][bla: ["hello"] append bla x] Now, if you are surprised here, you should realize that we are doing the same exact thing as above. BTW, even though I think that we need more docs, the best thing to learn something is to discover it by yourself. So trying to develop your own mental model, and proofing it with tests at the console, is really the best way to understand REBOL. It's not the easier way though, that's why we need more docs. Ah, did I say that we need more docs? (Sorry Gregg for copying your style. ;) Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amiga Group Italia sez. L'Aquila --- SOON: