Changeset 4446


Ignore:
Timestamp:
10/18/03 16:23:59 (18 years ago)
Author:
piso
Message:

Work in progress.

File:
1 edited

Legend:

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

    r4445 r4446  
    22;;;
    33;;; Copyright (C) 2003 Peter Graves
    4 ;;; $Id: compiler.lisp,v 1.50 2003-10-18 14:42:35 piso Exp $
     4;;; $Id: compiler.lisp,v 1.51 2003-10-18 16:23:59 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    121121
    122122(defun expand-local-macro (form)
    123   (funcall (local-macro-function (car form)) form nil))
     123  (let ((expansion (funcall (local-macro-function (car form)) form nil)))
     124    ;; If the expansion turns out to be a bare symbol, wrap it with PROGN so it
     125    ;; won't be mistaken for a tag in an enclosing TAGBODY.
     126    (if (symbolp expansion)
     127        (list 'progn expansion)
     128        expansion)))
    124129
    125130(defun compile-macrolet (form)
     
    172177       (let ((body (cdr form)))
    173178         (if (= (length body) 1)
    174              (compile-sexp (car body))
     179             (let ((res (compile-sexp (car body))))
     180               ;; If the result turns out to be a bare symbol, leave it wrapped
     181               ;; with PROGN so it won't be mistaken for a tag in an enclosing
     182               ;; TAGBODY.
     183               (if (symbolp res)
     184                   (list 'progn res)
     185                   res))
    175186             (cons 'progn (mapcar #'compile-sexp body)))))
    176187      (IF
Note: See TracChangeset for help on using the changeset viewer.