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

This is a bug?

 [1/6] from: rotenca::telvia::it at: 13-Sep-2001 15:46


This is a bug?
>> third context [a: 2]
== [a: 2]
>> pick context [a: 2] 3
** Script Error: Out of range or past end ** Near: pick context [a: 2] 3 --- Ciao Romano Paolo Tenca

 [2/6] from: joel:neely:fedex at: 14-Sep-2001 2:10


Hi, Romano, Romano Paolo Tenca wrote:
> This is a bug? > > >> third context [a: 2] > == [a: 2] > >> pick context [a: 2] 3 > ** Script Error: Out of range or past end > ** Near: pick context [a: 2] 3 >
It would certainly appear to be inconsistent, given
>> foo: make object! [a: 3] >> first foo
== [self a]
>> second foo
== [ make object! [ a: 3 ] 3]
>> third foo
== [a: 3]
>> pick foo 1
== [self a]
>> pick foo 2
== [ make object! [ a: 3 ] 3]
>> pick foo 3
** Script Error: Out of range or past end ** Near: pick foo 3 The unavailability of an authoritative specification for REBOL means that one can't really call such things "bugs" (unless someone at REBOL Technologies is willing to go on record with such a diagnosis). Sometimes such things are really flaws in the implementation (i.e., it doesn't do what RT intended), sometimes they are unexpected emergent properties (i.e., no real intention one way or the other, just confusing to those trying to construct their own mental models of REBOL), and sometimes they are deliberate (i.e., RT really had something specific in mind and there's an undocumented rationale for the behavior that's puzzling us outsiders). Holger's recent email on contexts represents a major landmark in the dialogue with RT on such issues. My thanks to him for the information! (And my envy to Ladislav for being able to stimulate the disclosure! Most of my own efforts to point out such issues and get explanations were met with either silence or sarcasm. ;-) I hope we get a definitive answer on your question as well. -jn- -- ------------------------------------------------------------ Programming languages: compact, powerful, simple ... Pick any two! joel'dot'neely'at'fedex'dot'com

 [3/6] from: greggirwin:starband at: 14-Sep-2001 9:57


Hi Joel, Interesting. The Core docs talk about first and second for an object returning the words and values for that object, respectively, but I don't think it mentions what third returns. It's a block of words and values, but the words have trailing colons. Q. What would be the best term for this kind of block? Q. What would it be useful for? Generic cloning? anonymous prototypes? Nothing? orig: make object! [a: 3] clone: make object! third orig
>> proto: [[a: 3][a: 4]]
== [[a: 3] [a: 4]]
>> bar: make object! first proto >> bar/a
== 3
>> bar: make object! last proto >> bar/a
== 4 --Gregg

 [4/6] from: rotenca:telvia:it at: 14-Sep-2001 18:49


No, the bug is not the result of third, should be the result of pick ... 3 You should read here: http://www.rebol.com/docs/core25.html#section-11 --- Ciao Romano

 [5/6] from: rotenca:telvia:it at: 14-Sep-2001 19:05


> Hi, Romano,
Hi, Joel,
> > >> pick context [a: 2] 3 > > ** Script Error: Out of range or past end > > ** Near: pick context [a: 2] 3 > > > > It would certainly appear to be inconsistent, given
Yes, it is exactly what i think. It is true that: http://www.rebol.com/docs/core25.html#section-11 speaks only of Third, but is also true that: pick :do 3 gives the same result of third :do. I think they forgot to implement it in Pick after implenting it in Third.
> sometimes they are deliberate (i.e., RT really had something > specific in mind and there's an undocumented rationale for the > behavior that's puzzling us outsiders).
My most frequent question: "there is a reason that i don't see for this behaviour of Rebol?" 99% the answer is YES. But remains that 1%...
> Holger's recent email on contexts represents a major landmark > in the dialogue with RT on such issues. My thanks to him for > the information!
In the mailing list? I did not see it.
> I hope we get a definitive answer on your question as well.
We can't survive without! :-)
> -jn-
--- Ciao Romano

 [6/6] from: ammoncooke:ya:hoo at: 14-Sep-2001 13:36


<snip...>
> In the mailing list? I did not see it. >
The subject was "Context-code included-2nd version" It was quite a lengthy, & informative discussion. Enjoy!! Ammon