annotate samples/testarray.tp @ 82:48daa1d3e052

Update testarray sample to use print:
author Mike Pavone <pavone@retrodev.com>
date Sat, 21 Jul 2012 22:28:21 -0700
parents 927fd7911a01
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