Changeset 8212
 Timestamp:
 12/04/04 15:48:38 (17 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/j/src/org/armedbear/lisp/precompiler.lisp
r8211 r8212 2 2 ;;; 3 3 ;;; Copyright (C) 20032004 Peter Graves 4 ;;; $Id: precompiler.lisp,v 1.8 1 20041203 18:27:36piso Exp $4 ;;; $Id: precompiler.lisp,v 1.82 20041204 15:48:38 piso Exp $ 5 5 ;;; 6 6 ;;; This program is free software; you can redistribute it and/or … … 371 371 (dolist (special specials) 372 372 (let ((sym (gensym))) 373 (let ((res ())) 373 (let ((res ()) 374 (keyp nil)) 374 375 (dolist (var lambdalist) 375 (cond ((and (consp var) (consp (first var)) 376 (cond ((eq var '&KEY) 377 (setf keyp t) 378 (push var res)) 379 ((and (consp var) (consp (first var)) 376 380 (eq special (second (first var)))) 377 381 (push (list (list (first (first var)) sym) (second var)) res)) … … 379 383 (push (cons sym (cdr var)) res)) 380 384 ((eq var special) 381 (push sym res)) 385 (if keyp 386 ;; "&key x" => "&key ((:x x) nil)" 387 (push (list (list (intern (symbolname var) sys:*keywordpackage*) 388 sym) 389 nil) 390 res) 391 (push sym res))) 382 392 (t 383 393 (push var res)))) 384 394 (setf lambdalist (nreverse res))) 385 395 (setf body (list (append (list 'LET* (list (list special sym))) body)))))) 386 (list* 'LAMBDA lambdalist (mapcar #'precompile1 body))))396 (list* 'LAMBDA lambdalist body))) 387 397 388 398 (defun precompilelambda (form) 389 (mayberewritelambda form)) 399 (setf form (mayberewritelambda form)) 400 (list* 'LAMBDA (cadr form) (mapcar #'precompile1 (cddr form)))) 390 401 391 402 (defun definelocalmacro (name lambdalist body) … … 589 600 (defun precompilefunction (form) 590 601 (if (and (consp (cadr form)) (eq (caadr form) 'LAMBDA)) 591 (list 'FUNCTION ( mayberewritelambda (cadr form)))602 (list 'FUNCTION (precompilelambda (cadr form))) 592 603 form)) 593 604
Note: See TracChangeset
for help on using the changeset viewer.