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

[REBOL] Re: Bug or feature ?

From: al:bri:xtra at: 11-Jan-2001 6:59

> >>items: [i1 7 i2 555] ;ok > >>items/i1 + 55 ; ok > >>items/i1: 4 + 12 ; ERROR, (items/i1: 4) returns block, not integer > > Should not > items/i1: 666 < behave like > items/i1 < ? >> items: [i1 7 i2 555]
== [i1 7 i2 555]
>> items/i1 + 55
== 62 Note that items/i1 returns the value 7, which then gets added to 55.
>> items
== [i1 7 i2 555] and note that the original block (or series) _doesn't_ get altered.
>> items/i1: 4 + 12
== [i1 16 i2 555] Note that the intent is assignment at 'i1 in the block of the result of 4 + 12, and Rebol returns the result, which is the changed block, as shown here:
>> items
== [i1 16 i2 555]
>> items/i1: 666
== [i1 666 i2 555]
>> items
== [i1 666 i2 555]
>> items/i1
== 666
> Should not > items/i1: 666 < behave like > items/i1 < ?
The first is set at the position and return the value (block) for reuse, while the second is get at the position and return the value. It's neither bug or "feature", but a part of the design of Rebol. I hope that helps! Andrew Martin ICQ: 26227169 http://members.nbci.com/AndrewMartin/