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

[REBOL] Re: The truth about scope

From: mokkel:gmx at: 16-Apr-2005 11:37

Hi Volker,
> About > bind bl in c 'a > Actually the value has a place! > Because 'bind has a return value ;)
Yes I know, I just first wanted to complain (note) that it's kind of awkward that one can't bind a single word in-place (bind 'a in c 'a). The 'a after the 'bind won't be changed. In the case of the "picking it out of a block" this looks to me quite naturally as I (one) decided what word to rebind (if one want's to bind a whole block it will always bind all words, but what if there are some words which shouldn't be bound - might be a bit constructed case nevertheless). So I just though would be good to check it against the model, whether it makes actually sense to try to do so. And then the observation was that because value-slots are copied (shallow), there is no way to reference a certain word, the spelling simply get's copied and thus there is no way to pick (and designate) a word out of a block, which will be changed. We will only get another "instance" of the word and if we 'get it, it referes to the value-slot in its according context-table. So in case of single words, bind has to return another word as return-value, that in case of a block it is returned also, is just consistency I guess. :-) I also haven't been too exact about the representation of block references in-code/data. Actually it should have been looked always like: a: 5 bl: [a "hallo" 1] -> (bl:) (|,1) | (a)-(|,1)-(1) ; real value-slot list | | (5) | (h)-(a)-(l)-(l)-(o) ; this are actually no real (I guess) value-slots any-more I usually only wrote (bl:) [(a) (|,1) (1)] ....... Thanks for taking a look at it. Regards Michael