Richard H. McCullough wrote:
> I wanted to process my list in chunks of 3, so I wrote
> nvlist := []
> every i := 1 to *longlist by 3 do
>     put(nvlist, longlist[i :+3])
> every nv := !nvlist do
>     ...
> But instead of getting 1:3, 4:6, 7:9, 10:12
> I got  1:2, 3:3, 6:3, 9:3
> 
> My thoughts are
> 1.  i :+3 seems natural, because two indices are separated by :
> and i is the first index.
> 2. I consulted the Unicon book, and found the "correct" way  i +: 3
> 3. The result I got makes no sense at all to me.

+ is a legal unary operator for absolute value, so, as Andrew mentioned, 
what you wrote is the same as writing:

    longlist[ i : +3]

just as

    longlist[ i:-3 ]

is treated as

    longlist[ i : -3 ]

You have to think of [+:],  [-:], and [:] as three list subsection 
operators instead of trying to view : as a separator.

-- 
--
Steve Wampler     [EMAIL PROTECTED]
The gods that smiled upon your birth are laughing now. -- fortune cookie

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Unicon-group mailing list
Unicon-group@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/unicon-group

Reply via email to