Changeset 4443


Ignore:
Timestamp:
10/17/03 23:57:33 (19 years ago)
Author:
piso
Message:

COMPILE-MACROLET

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/compiler.lisp

    r4416 r4443  
    22;;;
    33;;; Copyright (C) 2003 Peter Graves
    4 ;;; $Id: compiler.lisp,v 1.47 2003-10-16 23:12:48 piso Exp $
     4;;; $Id: compiler.lisp,v 1.48 2003-10-17 23:57:33 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    9494          (setq result (append result (list var)))))
    9595    result))
     96
     97(defun compile-macrolet (form)
     98  (let ((macros (cadr form))
     99        (body (cddr form))
     100        (res ()))
     101    (dolist (macro macros)
     102      (let ((name (car macro))
     103            (lambda-list (cadr macro))
     104            (forms (cddr macro)))
     105        (push (list* name lambda-list (compile-progn forms)) res)))
     106    (list* 'macrolet (reverse res) (compile-progn body))))
    96107
    97108(defun compile-special (form)
     
    163174       (compile-sexp (caddr form)))
    164175      (GO form)
     176      (MACROLET
     177       (compile-macrolet form))
    165178      (t
    166179;;        (format t "COMPILE-SPECIAL skipping ~S~%" first)
Note: See TracChangeset for help on using the changeset viewer.