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

[REBOL] Re: "AT" usage, strange..

From: al::bri::xtra::co::nz at: 6-Nov-2000 21:23

Sharriff asked:
> Could someone explain why this happens? (see below) > > >> test: [one: "value1" two: "value2" three: "value3" ] > == [one: "value1" two: "value2" three: "value3"] > >> length? test > == 6 > >> print at test 3 > value2 value3 > > according to the REBOL dictionary: > > " > Provides a simple way to index into a series. AT returns the series at
the
> new index point. Note that the operation is relative to the current > position within the series. " > why are the words in the block not retured also? they are also elements of
the block "test" and therefore also indexed?
>> test: [one: "value1" two: "value2" three: "value3" ]
== [one: "value1" two: "value2" three: "value3"]
>> length? test
== 6
>> at test 3
== [two: "value2" three: "value3"]
>> reduce at test 3
== ["value2" "value3"]
>> print [two: "value2" three: "value3"]
value2 value3
>> two
== "value2"
>> three
== "value3" Check out page 83 of the Core manual, about 'print using 'reduce as part of it's operation. I hope that helps! Andrew Martin ICQ: 26227169 http://members.nbci.com/AndrewMartin/