annotate samples/testarray.tp @ 253:697c2c562af2

Fix infinite loop in hash dict
author Michael Pavone <pavone@retrodev.com>
date Sat, 31 May 2014 21:27:03 -0700
parents 48daa1d3e052
children 810b6115c1d4
rev   line source
pavone@39 1 #{
pavone@40 2 sum <- :arr {
pavone@40 3 cursum <- 0
pavone@40 4 foreach: arr :idx el {
pavone@40 5 cursum <- cursum + el
pavone@40 6 }
pavone@40 7 cursum
pavone@40 8 }
pavone@39 9 main <- {
pavone@39 10 foo <- #[42 30 28]
pavone@40 11 bar <- #[]
pavone@40 12 bar append: 30
pavone@40 13 bar append: 28
pavone@40 14 bar append: 42
pavone@82 15 print: "" . ((sum: foo) + (sum: bar)) . "\n"
pavone@39 16 }
pavone@39 17 }
pavone@39 18