Time to Stop Saying "Pure/Virtual" Binding

Rebol's historical model of binding was to mutably paste hidden "binding" pointers onto WORD!s in code, that influenced the lookup... which isn't always bad. But what I think was definitely bad was that this was the only binding there was.

There were big weaknesses. Such as that if WORD!s in a method in a function body had to resolve to a specific variable, you'd have to copy and re-paste bindings on bodies of methods to create a new instance of that object. That was crazy. :zany_face:

Yet sometimes WORD!s had to carry knowledge of where they looked up to. The trick became knowing when this binding should be carried by the word, and when it shouldn't.

  • As these ideas evolved, I used "virtual binding" as a sort of blanket term to mean that the WORD!s themselves may be unbound, but it was things like BLOCK! instances that carried contextual/enviroment information... which the unbound words could be looked up in at arbitrary points, taking into account any new definitions vs. being stucked in a fixed concept from a prior "wave" of mutable binding.

  • When this idea escalated to its logical conclusion, I called it "pure virtual binding", to imply that when you start running module or script code from the top none of the code carries a binding. When everything comes after the fact, you get things like:

    >> doubler: func [x] [
           let code: copy [add x]
           append code to word! "x"
           print ["Doubled:" eval code]
       ]
    
    >> doubler 10
    Doubled: 20  ; wait... that *worked*?! 😮
    

These Terms Have Become Meaningless

"virtual binding" and "pure virtual binding" are nothing but historical terms.

There is only "binding", and everything else just a transient term used while trying to pin down how it should act.

I particularly want to reclaim the term PURE because we need to start marking functions that don't have side-effects. (Oddly enough, "Rye" has beaten me to the punch with actually deploying this, though I've advocated for it a long time before that...just never got around to it, for whatever reason.)

But reclaiming the term VIRTUAL is probably useful as well.

Please Excuse WikiMan As He Edits Your Posts

As I Wiki-Edit this forum to try and make it non-useless for modern audiences, expect to see the terms "virtual binding" and "pure virtual binding" be relegated to the Archive

In spirit we could still say that binding does have "virtual" and "non-virtual" components, but there's no need to waste the term "virtual". We just say that a BLOCK! might be bound, while the WORD!s in it could be bound--or unbound. If the words in it are BOUND! and you project the binding, then you're acting "virtually".

Anyway, I am going to stop using the terms...and so should you (though really, has anyone else besides me ever uttered the phrases: "virtual binding" or "pure virtual binding"? probably not :face_with_diagonal_mouth:)

1 Like