diff --git a/ruamoko/scheme/Compiler.r b/ruamoko/scheme/Compiler.r index e2808f00a..f9e276390 100644 --- a/ruamoko/scheme/Compiler.r +++ b/ruamoko/scheme/Compiler.r @@ -11,6 +11,7 @@ Symbol quoteSym; Symbol defineSym; Symbol ifSym; Symbol letrecSym; +Symbol beginSym; @implementation Compiler + (void) initialize @@ -25,6 +26,8 @@ Symbol letrecSym; [ifSym retain]; letrecSym = symbol("letrec"); [letrecSym retain]; + beginSym = symbol("begin"); + [beginSym retain]; } + (id) newWithLambda: (SchemeObject) xp scope: (Scope) sc @@ -236,6 +239,8 @@ Symbol letrecSym; [self emitIf: [expression cdr] flags: fl]; } else if ([expression car] == letrecSym) { [self emitLetrec: [expression cdr] flags: fl]; + } else if ([expression car] == beginSym) { + [self emitSequence: [expression cdr] flags: fl]; } else { [self emitApply: expression flags: fl]; } diff --git a/ruamoko/scheme/Cons.r b/ruamoko/scheme/Cons.r index 399b36134..dcffd2862 100644 --- a/ruamoko/scheme/Cons.r +++ b/ruamoko/scheme/Cons.r @@ -2,6 +2,7 @@ #include "Cons.h" #include "Nil.h" #include "defs.h" +#include "SchemeString.h" Cons cons (SchemeObject car, SchemeObject cdr) { @@ -75,7 +76,7 @@ BOOL isList (SchemeObject ls) - (string) printForm { - local string acc = "", res; + local string acc = ""; local id cur, next = NIL; for (cur = self; cur; cur = next) { @@ -91,9 +92,7 @@ BOOL isList (SchemeObject ls) } } - res = str_new(); - str_copy(res, sprintf("(%s)", acc)); - return res; + return [[String newFromString: sprintf("(%s)", acc)] stringValue]; } @end diff --git a/ruamoko/scheme/SchemeObject.r b/ruamoko/scheme/SchemeObject.r index 0decbbc8d..fb16a812f 100644 --- a/ruamoko/scheme/SchemeObject.r +++ b/ruamoko/scheme/SchemeObject.r @@ -14,7 +14,7 @@ typedef enum { gc_state_e gc_state; integer checkpoint; -#define GC_AMOUNT 200 +#define GC_AMOUNT 100 @implementation SchemeObject