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: 14-Apr-2005 14:46

Hi Volker, On Thursday, April 14, 2005, 1:12:08 PM, you wrote: VN> i guess you made a typo and now we have a misunderstanding. Well, no. But, that is an implementation detail. The position in series is kept in the value. So, S and B/1, from the point of view of implementation, are two distinct but identical values. Of course, Ladislav is right in saying that because you cannot discern them, they are the same. However, they are not in the current implementation, and my point is that they don't need to be (as with the example with SKIP I showed afterwards) to show the behavior we were discussing. The behavior we were discussing is that of modifying a series value. Series values have a reference to the data sequence and a position in the sequence. What you change with INSERT etc. though is the sequence of elements. So, even though you may have two different series values (same sequence but different positions), you are still seeing the behavior we were discussing. For this reason, the sentence "they are the exact same value" is not precise; first, because it is not true in the implementation (and this doesn't mean much, but not knowing this may lead to a wrong model of the implementation, and having a correct model of the implementation helps when you are dealing with GC bugs and trying to work around them, for example ;), and second because even if the values where not the same exact value you'd get the same result. Anyway, here's the reason why I was leaving this detail without discussing about it. You see, it gets very confusing very soon. ;-) And, it doesn't matter for the explanation. To conclude, I agree with Ladislav that [1 1] may be considered a series containing the same value twice, and I agree that the position in the series is not an attribute of the value. However, we know that in the current REBOL implementation a block is an array of value slots and an integer fits one value slot, so [1 1] is two value slots with two values (which are identical). I agree that this is an implementation detail and that it is irrelevant. Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amiga Group Italia sez. L'Aquila --- SOON: