Mercurial > repos > icfp2014
annotate code/test.lm @ 7:afd55b32549b
Implement support for local variables and top level functions
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Fri, 25 Jul 2014 13:47:21 -0700 |
parents | a9a2ad99adfb |
children | 494ef2e3a756 |
rev | line source |
---|---|
1
68d1447bfdbe
Support for compiling lists, tuples and integer literals in lmc. Added small test lm program for exercising compiler.
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1 #{ |
7
afd55b32549b
Implement support for local variables and top level functions
Michael Pavone <pavone@retrodev.com>
parents:
3
diff
changeset
|
2 step <- :myState :world { |
afd55b32549b
Implement support for local variables and top level functions
Michael Pavone <pavone@retrodev.com>
parents:
3
diff
changeset
|
3 foo <- 1234 |
afd55b32549b
Implement support for local variables and top level functions
Michael Pavone <pavone@retrodev.com>
parents:
3
diff
changeset
|
4 if: (isInteger?: 1 | [(2 + 32 * 8) 3 4]) { |
afd55b32549b
Implement support for local variables and top level functions
Michael Pavone <pavone@retrodev.com>
parents:
3
diff
changeset
|
5 myState <- 42 |
afd55b32549b
Implement support for local variables and top level functions
Michael Pavone <pavone@retrodev.com>
parents:
3
diff
changeset
|
6 } else: { |
afd55b32549b
Implement support for local variables and top level functions
Michael Pavone <pavone@retrodev.com>
parents:
3
diff
changeset
|
7 myState <- 24 |
afd55b32549b
Implement support for local variables and top level functions
Michael Pavone <pavone@retrodev.com>
parents:
3
diff
changeset
|
8 } |
afd55b32549b
Implement support for local variables and top level functions
Michael Pavone <pavone@retrodev.com>
parents:
3
diff
changeset
|
9 #[myState 1] |
1
68d1447bfdbe
Support for compiling lists, tuples and integer literals in lmc. Added small test lm program for exercising compiler.
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
10 } |
68d1447bfdbe
Support for compiling lists, tuples and integer literals in lmc. Added small test lm program for exercising compiler.
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
11 |
68d1447bfdbe
Support for compiling lists, tuples and integer literals in lmc. Added small test lm program for exercising compiler.
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
12 main <- { |
7
afd55b32549b
Implement support for local variables and top level functions
Michael Pavone <pavone@retrodev.com>
parents:
3
diff
changeset
|
13 #[0 step] |
1
68d1447bfdbe
Support for compiling lists, tuples and integer literals in lmc. Added small test lm program for exercising compiler.
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
14 } |
68d1447bfdbe
Support for compiling lists, tuples and integer literals in lmc. Added small test lm program for exercising compiler.
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
15 } |