World: r3wp
[I'm new] Ask any question, and a helpful person will try to answer.
older newer | first last |
Duke 29-Nov-2010 [3965] | @Brian So Rebol is not a stack-based language like Forth, or concatenative languages, like Joy, Cat etc? |
BrianH 29-Nov-2010 [3966] | Nope. I haven't used the others but like Cat a lot. Too bad the author has (temporarily?) abandoned the project. |
Duke 29-Nov-2010 [3967] | @Brian OK! I can get rid of _that_ mindset in trying to understand Rebol :) |
BrianH 29-Nov-2010 [3968] | REBOL is more like an interpreted Lisp, with a Forth-like direct binding model. |
Duke 29-Nov-2010 [3969] | @Brian kinda like newLisp, then - which I have dabbled in, and liked |
BrianH 29-Nov-2010 [3970x2] | newLisp is more compiled than REBOL, and has dynamic binding, which is a completely different concept. |
Unfortunately, it is a bit hard to explain direct binding to people already familiar with lexical or dynamic binding. | |
Duke 29-Nov-2010 [3972x2] | @Brian I hear you! Please don't try ;) now now. I'm still in the KISS mode as far as Rebol is concerned |
BTW, KISS refering to _me_ NOT you | |
BrianH 29-Nov-2010 [3974x2] | We all have our moments :) |
In the simple phase of your REBOL education, all you need to know is that we have something called "direct binding", where words have direct references to their values, but that in most cases it acts like lexical binding because we fake it. So write your code as if it's lexically bound until you run into problems, then come back and be new again for the next level :) | |
Duke 29-Nov-2010 [3976] | Cool! :) |
BrianH 29-Nov-2010 [3977] | I run into these next levels pretty often, usually after a conversation with Carl or Ladislav. It's no problem to be new again :) |
Ladislav 29-Nov-2010 [3978x3] | This looks simple enough to be readable just finely: http://blog.revolucent.net/2009/07/deep-rebol-bindology.html |
One thing that attracted my attention in the article: ...interesting fact about REBOL blocks: By default, their evaluation is deferred. - not being a native speaker, I do not know, whether it means the same as: ...interesting fact about REBOL blocks: They are not evaluated (i.e. understood as 'data', not as 'code'), unless an evaluation is explicitly requested. | |
(but that is just nitpicking from me, the text is fine) | |
BrianH 29-Nov-2010 [3981] | It's that terminology bug all over again. Good point, and good article. |
Steeve 29-Nov-2010 [3982] | Well, about binding in Rebol, it's not that hard to understand. The context of any word is a hidden property. Meaning it can be changed at any time. |
Ladislav 29-Nov-2010 [3983x2] | It is very hard to find the best terminology to describe the properties (like "evaluation"), exactly because they differ from the common cases in other languages. |
yes to "The context of any word is a hidden property.", but "it can be changed at any time" is a bit complicated by the fact, that it is "immutable", meaning, that you create a new word with a different context, when you want it, instead of changing the original | |
Steeve 29-Nov-2010 [3985x5] | if its an internal (silent) reconstruction we don't bother. the behavior acts like a change. a: [obj] bind a context [obj: 1] do a == 1 From my point a view the serie A has bit been modified. |
*From my point a view the serie A has not been modified. | |
And the same word OBJ got a new context | |
Ladislav, I see your point, except it's not a problem from my point of view. ;-) | |
Probably we shoold invent new vocables. instead of "direct" binding like Brian said. I would say "space" binding. in the block: b: [ a a a a ] Each word 'A' may have different contexts. Beause they occupy diffenrt locations in "space" That"s all. :-) | |
BrianH 29-Nov-2010 [3990] | Funny :) |
Steeve 29-Nov-2010 [3991] | to go further. If we admit that words may change of context during time. Then, Rebol process "spacetime" binding |
BrianH 29-Nov-2010 [3992] | Strangely enough, they don't really change binding, they are replaced with new words of the same spelling and new binding. Words are immutable, like integers. That is what Ladislav was talking about. The functionality is great, but terminology that implies that words can change binding is not really true. |
Steeve 29-Nov-2010 [3993x3] | Yeah I see your point but I still can pretend. |
It's not a spacetime law violation | |
After new binding, Even if you say that the "cell" contains (hidden)pointers to different locations in memory. The cell himself remains at the same location in the block and has the same "public" name. So that I can say : the same "cell" in the same block with the same name has a different context. | |
BrianH 29-Nov-2010 [3996x3] | Yup. |
But the interesting thing is that the immutability of words makes BIND behave differently when passed a word (which it can't modify) versus a block (which it can). So when you bind a block, you aren't modifying the words in the block, you are modifying the block itself. This is an important distinction that we shouldn't gloss over because that tends to confuse newbies later. | |
that tends to confuse -> *glossing over the distinction* tends to confuse | |
Ladislav 29-Nov-2010 [3999] | Yes, the main problem is, that the "From my point a view the serie A has not been modified." will shoot you in the foot, as demonstrated in the bindology article |
Steeve 29-Nov-2010 [4000] | yes finally, maybe I raved too much :-) |
BrianH 29-Nov-2010 [4001] | We all reach our limits there too :) |
Ladislav 29-Nov-2010 [4002] | Therefore, the introduction of "modifies" comments is needed (and useful!) |
Steeve 29-Nov-2010 [4003x2] | Instead of spacetime modification, it's spacetime travel |
hefty... | |
BrianH 29-Nov-2010 [4005] | I used to use the term "applicative binding order" for REBOL's binding model, but later on Carl started calling it "definitional binding", which is a bit less descriptive but sounds better. |
Steeve 29-Nov-2010 [4006] | sounds better than spacetime travel ? |
BrianH 29-Nov-2010 [4007] | Sounds better than "applicative binding order". Time will tell if the increased explanation needed will be outweighed by having a cooler term. |
Ladislav 29-Nov-2010 [4008] | I am a fan of the "definitional binding", since it is short enough (just two words, i.e. the same length as alternatives, like "dynamic binding" or "lexical scoping"), as well as different enough from the alternatives |
BrianH 29-Nov-2010 [4009] | It is cooler, yes :) |
Steeve 29-Nov-2010 [4010x2] | but what does that mean exactly ? Definitional ? |
I mean, in that context :-) | |
Ladislav 29-Nov-2010 [4012] | I perceive it as referring to the fact, that e.g. the binding of the function locals is done when the function is defined. |
Steeve 29-Nov-2010 [4013] | It sounds weird in French |
Ladislav 29-Nov-2010 [4014] | (but that may be just my own interpretation) |
older newer | first last |