Bug - Pick gives different results depending upon it's data
[1/3] from: al::bri::xtra::co::nz at: 6-Jan-2001 7:55
Sascha wrote:
> i found this:
What Sascha seems to be refering to is where 'pick on a block! and object!
with zero returns different types of results:
>> rebol/version
== 2.4.39.3.1
>> b: [1 2]
== [1 2]
>> pick b 1
== 1
>> pick b 0 ; Note none result here.
== none
>> o: make object! [m: 123]
>> pick o 1
== [self m]
>> pick o 0 ; Note error result here.
** Script Error: Out of range or past end
** Near: pick o 0
and:
>> pick :+ 0 ; Crashes Rebol.
'pick with an out of range index on a object or function should return none.
Andrew Martin
ICQ: 26227169 http://members.nbci.com/AndrewMartin/
[2/3] from: lmecir:mbox:vol:cz at: 5-Jan-2001 20:12
Hi,
Andrew wrote:
> 'pick with an out of range index on a object or function should return
none.
> Andrew Martin
> ICQ: 26227169 http://members.nbci.com/AndrewMartin/
> -><-
I would prefer PICK to behave like the PICK-PROP I proposed earlier, i.e. to
fire an error or evaluate the specified handler.
Regards
Ladislav
[3/3] from: al:bri:xtra at: 6-Jan-2001 8:49
> Andrew wrote:
> > 'pick with an out of range index on a object or function should return
none.
Ladislav wrote:
> I would prefer PICK to behave like the PICK-PROP I proposed earlier, i.e.
to fire an error or evaluate the specified handler.
We can get some of that functionality with:
any [pick block 0 make error! "message here"]
or:
any [pick block 0 DefaultActionFunction]
I think that's acceptable enough for me. Also, I'd make sure that 'none
doesn't get into the block in the first place.
Andrew Martin
ICQ: 26227169 http://members.nbci.com/AndrewMartin/