iris

small scheme interpreter
git clone git://git.2f30.org/iris.git
Log | Files | Refs | LICENSE

commit 4f289484594b60471c352e8120cf87d8a54f11a7
parent dcfba9294a0d4077eecf724686a858676711e642
Author: sin <sin@2f30.org>
Date:   Wed May 14 14:20:39 +0100

Use a switch statement

Diffstat:
parser.c | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/parser.c b/parser.c @@ -281,12 +281,13 @@ printpair(struct object *o) car = o->d.p.car; cdr = o->d.p.cdr; print(car); - if (cdr->type == OPair) { + switch (cdr->type) { + case OPair: putchar(' '); printpair(cdr); - } else if (cdr->type == OEmptylist) { + case OEmptylist: return; - } else { + default: putchar(' '); putchar('.'); putchar(' ');