Changeset 4889


Ignore:
Timestamp:
11/24/03 21:25:01 (18 years ago)
Author:
piso
Message:

PRECOMPILE-LAMBDA: recognize special variables in lambda list.

File:
1 edited

Legend:

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

    r4888 r4889  
    22;;;
    33;;; Copyright (C) 2003 Peter Graves
    4 ;;; $Id: precompiler.lisp,v 1.13 2003-11-24 17:15:00 piso Exp $
     4;;; $Id: precompiler.lisp,v 1.14 2003-11-24 21:25:01 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    171171      (setf lambda-list (subseq lambda-list 0 (position '&AUX lambda-list)))
    172172      (setf body (list (append (list 'LET* (cdr auxvars)) body))))
     173    (let ((specials ()))
     174      (dolist (var lambda-list)
     175        (when (special-variable-p var)
     176          (push var specials)))
     177      (when specials
     178        (dolist (var specials)
     179          (let ((sym (gensym)))
     180            (setf lambda-list (subst sym var lambda-list))
     181            (setf body (list (append (list 'LET* (list (list var sym))) body)))))))
    173182    (list* 'LAMBDA lambda-list (mapcar #'precompile1 body))))
    174183
Note: See TracChangeset for help on using the changeset viewer.