Created
May 6, 2014 00:50
-
-
Save jots/11550953 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var buckets: array[0..9, string] | |
| # initialize. wish they were automagically initialized | |
| for i in 0..buckets.high: buckets[i] = "" | |
| # XXX not work | |
| for i in 0..1: | |
| for buck in buckets: | |
| # following line doesn't work. compile error: | |
| # Error: for a 'var' type a variable needs to be passed | |
| #buck &= "test" | |
| # works. | |
| for i in 0..1: | |
| for x in 0..buckets.high: | |
| buckets[x] &= "appending: " & $x | |
| for x in 0..buckets.high: | |
| echo buckets[x] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment