Sidney Reilley II <[email protected]> skribis:
> The following snippet is taken from Thomas W. Christopher's book,
> "Icon Programming Language Handbook", page 36
>
> [quote]
> The to operator associates to the left, e.g.,
>
> every writes(" ",1 to 2 to 3)
> [/quote]
>
> I don't understand how the following produces:
>
> 12323
>
> I'm reading the above code as:
>
> write "each" integer 1 and 2 then "each" integer 2 and 3
>
> So I'm thinking the result should be:
>
> 1223
>
> but obviously I'm wrong, and I'm missing a piece of the puzzle.
every writes(" ",(1 to 2) to 3)
First tries (1 to 3) then tries (2 to 3), before failing, giving "1 2
3" followed by "2 3".
every writes(" ", 1 to (2 to 3))
would try (1 to 2) and then (1 to 3), giving "1 2" followed by "1 2 3".
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Unicon-group mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/unicon-group