Changeset 7360


Ignore:
Timestamp:
08/03/04 16:47:49 (17 years ago)
Author:
piso
Message:

EVAL-WHEN

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/define-symbol-macro.lisp

    r4548 r7360  
    11;;; define-symbol-macro.lisp
    22;;;
    3 ;;; Copyright (C) 2003 Peter Graves
    4 ;;; $Id: define-symbol-macro.lisp,v 1.2 2003-10-26 19:13:57 piso Exp $
     3;;; Copyright (C) 2003-2004 Peter Graves
     4;;; $Id: define-symbol-macro.lisp,v 1.3 2004-08-03 16:47:49 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    2020(in-package "SYSTEM")
    2121
     22(defun %define-symbol-macro (symbol expansion)
     23  (setf (symbol-value symbol) (make-symbol-macro expansion))
     24  symbol)
     25
    2226(defmacro define-symbol-macro (symbol expansion)
    2327  (when (special-variable-p symbol)
    24     (error 'program-error "~S has already been defined as a global variable" symbol))
    25   `(progn
    26      (setf (symbol-value ',symbol) (make-symbol-macro ',expansion))
    27      ',symbol))
     28    (error 'program-error "~S has already been defined as a global variable." symbol))
     29  `(eval-when (:compile-toplevel :load-toplevel :execute)
     30     (%define-symbol-macro ',symbol ',expansion)))
Note: See TracChangeset for help on using the changeset viewer.