summary refs log tree commit diff stats
path: root/compiler/main.nim
Commit message (Expand)AuthorAgeFilesLines
...
* Speed-up symbolFiles:on operations on windowsZahary Karadjov2011-12-071-12/+10
* bugfixes for .rod files and visual C++Araq2011-12-031-1/+1
* cleaned up configuration file handling and documented the new behaviourAraq2011-11-301-10/+10
* argument passing with --run option works againAraq2011-11-271-2/+2
* New algorithm for locating and loading nimrod config files.Zahary Karadjov2011-11-251-78/+79
* compilation cache: multi methods now workAraq2011-10-241-0/+1
* compilation cache: better dependency checkingAraq2011-10-231-0/+1
* much more efficient rod file generationAraq2011-10-181-25/+17
* added system.slurp for easy embedding of resourcesAraq2011-08-101-2/+4
* json code generation works againAraq2011-08-071-1/+1
* support for C++ code generation; importcpp and importobjc pragmasAraq2011-08-071-2/+2
* lexer, parser cleanup; boehm gc for mac os xAraq2011-05-171-3/+3
* const table supportAraq2011-04-291-2/+2
* got rid of some arcane module namesAraq2011-04-211-1/+1
* better error message for invalid module namesAraq2011-04-161-1/+1
* big repo cleanupAraq2011-04-121-0/+279
                                                   
                             
                                                   
                           


                                               
(function init-counter [
  (default-space:space-address <- new space:literal 30:literal)
  (n:integer <- next-input)
  (reply default-space:space-address)
 ])

(function increment-counter [
  (default-space:space-address <- new space:literal 30:literal)
  (0:space-address/names:init-counter <- next-input)  ; setup outer space; it *must* come from 'init-counter'
  (x:integer <- next-input)
  (n:integer/space:1 <- add n:integer/space:1 x:integer)
  (reply n:integer/space:1)
 ])

(function main [
  (default-space:space-address <- new space:literal 30:literal)
  ; counter A
  (a:space-address <- init-counter 34:literal)
  ; counter B
  (b:space-address <- init-counter 23:literal)
  ; increment both by 2 but in different ways
  (increment-counter a:space-address 1:literal)
  (bres:integer <- increment-counter b:space-address 2:literal)
  (ares:integer <- increment-counter a:space-address 1:literal)
  ; check results
  ($print (("Contents of counters a: " literal)))
  (print-integer nil:literal/terminal ares:integer)
  ($print ((" b: " literal)))
  (print-integer nil:literal/terminal bres:integer)
  ($print (("\n" literal)))
 ])

; compare http://www.paulgraham.com/accgen.html