annotate code/test.lm @ 3:a9a2ad99adfb

Rework lmc a bit to support labels in generated code. Add support for certain special funcall expressions, namely: if:else, isInteger? value and tail which translate to SEL ATOM CAR and CDR respectively
author Michael Pavone <pavone@retrodev.com>
date Fri, 25 Jul 2014 10:52:17 -0700
parents 71e8d638da5c
children afd55b32549b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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 #{
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
2 init <- {
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
3 #[1 2 3 4]
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
4 }
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
5
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
6 main <- {
3
a9a2ad99adfb Rework lmc a bit to support labels in generated code. Add support for certain special funcall expressions, namely: if:else, isInteger? value and tail which translate to SEL ATOM CAR and CDR respectively
Michael Pavone <pavone@retrodev.com>
parents: 2
diff changeset
7 if: (isInteger?: 1 | [(2 + 32 * 8) 3 4]) {
a9a2ad99adfb Rework lmc a bit to support labels in generated code. Add support for certain special funcall expressions, namely: if:else, isInteger? value and tail which translate to SEL ATOM CAR and CDR respectively
Michael Pavone <pavone@retrodev.com>
parents: 2
diff changeset
8 42
a9a2ad99adfb Rework lmc a bit to support labels in generated code. Add support for certain special funcall expressions, namely: if:else, isInteger? value and tail which translate to SEL ATOM CAR and CDR respectively
Michael Pavone <pavone@retrodev.com>
parents: 2
diff changeset
9 } else: {
a9a2ad99adfb Rework lmc a bit to support labels in generated code. Add support for certain special funcall expressions, namely: if:else, isInteger? value and tail which translate to SEL ATOM CAR and CDR respectively
Michael Pavone <pavone@retrodev.com>
parents: 2
diff changeset
10 24
a9a2ad99adfb Rework lmc a bit to support labels in generated code. Add support for certain special funcall expressions, namely: if:else, isInteger? value and tail which translate to SEL ATOM CAR and CDR respectively
Michael Pavone <pavone@retrodev.com>
parents: 2
diff changeset
11 }
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
12 }
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
13 }