Changeset 4987


Ignore:
Timestamp:
12/06/03 02:44:23 (18 years ago)
Author:
piso
Message:

COMPILE-LOCALLY

File:
1 edited

Legend:

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

    r4986 r4987  
    22;;;
    33;;; Copyright (C) 2003 Peter Graves
    4 ;;; $Id: jvm.lisp,v 1.52 2003-12-06 01:27:54 piso Exp $
     4;;; $Id: jvm.lisp,v 1.53 2003-12-06 02:44:23 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    18391839  (setq *max-locals* (max *max-locals* (fill-pointer *locals*))))
    18401840
     1841;; Returns list of declared specials.
     1842(defun process-special-declarations (forms)
     1843  (let ((specials ()))
     1844    (dolist (form forms)
     1845      (unless (and (consp form) (eq (car form) 'declare))
     1846        (return))
     1847      (let ((decls (cdr form)))
     1848        (dolist (decl decls)
     1849          (when (eq (car decl) 'special)
     1850            (setf specials (append (cdr decl) specials))))))
     1851    specials))
     1852
     1853(defun compile-locally (form for-effect)
     1854  (let ((*variables* *variables*)
     1855        (specials (process-special-declarations (cdr form))))
     1856    (dolist (var specials)
     1857      (push-variable var t nil))
     1858    (cond ((null (cdr form))
     1859           (emit-push-nil)
     1860           (emit-store-value))
     1861          (t
     1862           (do ((forms (cdr form) (cdr forms)))
     1863               ((null forms))
     1864             (compile-form (car forms) (cdr forms)))))))
     1865
    18411866(defvar *tags* ())
    18421867
     
    24372462                          go
    24382463                          if
     2464                          locally
    24392465                          multiple-value-list
    24402466                          progn
Note: See TracChangeset for help on using the changeset viewer.