Changeset 5856


Ignore:
Timestamp:
02/16/04 19:14:00 (17 years ago)
Author:
piso
Message:

DEFMETHOD: environment support.

File:
1 edited

Legend:

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

    r5814 r5856  
    22;;;
    33;;; Copyright (C) 2003-2004 Peter Graves
    4 ;;; $Id: clos.lisp,v 1.85 2004-02-14 00:20:26 piso Exp $
     4;;; $Id: clos.lisp,v 1.86 2004-02-16 19:14:00 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    943943    gf))
    944944
    945 ;;; Run-time environment hacking (Common Lisp ain't got 'em).
    946 
    947945(defun top-level-environment ()
    948   nil) ; Bogus top level lexical environment
    949 
    950 (defvar compile-methods nil)      ; by default, run everything interpreted
     946  nil)
    951947
    952948(defun compile-in-lexical-environment (env lambda-expr)
    953   (declare (ignore env))
    954   (if compile-methods
    955       (compile nil lambda-expr)
    956       (eval `(function ,lambda-expr))))
    957 
    958 (defmacro defmethod (&rest args)
     949  (make-closure lambda-expr env))
     950
     951(defmacro defmethod (&rest args &environment environment)
    959952  (multiple-value-bind
    960953    (function-name qualifiers lambda-list specializers documentation declarations body)
     
    972965                      :declarations ',declarations
    973966                      :body ',body
    974                       :environment (top-level-environment)))))
     967                      :environment ,environment))))
    975968
    976969(defun canonicalize-specializers (specializers)
Note: See TracChangeset for help on using the changeset viewer.