From 3660755f4a18b243d04e5edf4cfcd11df16dd6c4 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Mon, 19 Jul 2010 23:55:07 +0900 Subject: [PATCH] updating macroexpand, exporting ast->sexp --- lib/chibi/macroexpand.module | 2 +- lib/chibi/macroexpand.scm | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/chibi/macroexpand.module b/lib/chibi/macroexpand.module index 47b0e7d4..c9a3fd8c 100644 --- a/lib/chibi/macroexpand.module +++ b/lib/chibi/macroexpand.module @@ -2,5 +2,5 @@ (define-module (chibi macroexpand) (import-immutable (scheme)) (import (chibi ast)) - (export macroexpand) + (export macroexpand ast->sexp) (include "macroexpand.scm")) diff --git a/lib/chibi/macroexpand.scm b/lib/chibi/macroexpand.scm index a040855a..81cb566f 100644 --- a/lib/chibi/macroexpand.scm +++ b/lib/chibi/macroexpand.scm @@ -68,7 +68,8 @@ (cond ((lambda? x) `(lambda ,(map (lambda (id) (get-rename id x renames)) (lambda-params x)) - ,@(map (lambda (d) `(define ,(identifier->symbol (cadr d)) #f)) (lambda-defs x)) + ,@(map (lambda (d) `(define ,(identifier->symbol (cadar d)) #f)) + (lambda-defs x)) ,@(if (seq? (lambda-body x)) (map a2s (seq-ls (lambda-body x))) (list (a2s (lambda-body x))))))