[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Issue SYNTACTIC-ENVIRONMENT-ACCESS, v2
- To: cl-compiler@SAIL.STANFORD.EDU
- Subject: Issue SYNTACTIC-ENVIRONMENT-ACCESS, v2
- From: Kim A. Barrett <IIM%ECLA@ECLC.USC.EDU>
- Date: Sat 18 Feb 89 19:18:47-PST
- Cc: iim%ECLA@ECLC.USC.EDU
In the discussion for SEMANTIC-ENVIRONMENT-ACCESS version 2 (SEA-2) I mentioned
that there are some accessor/update pairs associated with defining forms which
are missing from Common Lisp. Below is a table of all the Common Lisp defining
macros (assuming I haven't missed any), along with their associated functions
Note that this isn't just a mindless exercise in filling holes. The missing
functions are needed if you want to write a portable 'file compiler' that wants
to treat these forms as special-forms that it knows how to deal with, since to
do so in any reasonable fashion requires hooking into the implementations
mechanisms for recording compile-time information.
Defining form Accessor Create/Update
DEFCLASS FIND-CLASS ENSURE-CLASS
DEFCONSTANT CONSTANTP **
DEFGENERIC FDEFINITION * ENSURE-GENERIC-FUNCTION
DEFINE-METHOD-COMBINATION FIND-METHOD-COMBINATION *
DEFINE-MODIFY-MACRO MACRO-FUNCTION (SETF MACRO-FUNCTION)
DEFMACRO MACRO-FUNCTION (SETF MACRO-FUNCTION)
DEFMETHOD FDEFINITION * ENSURE-GENERIC-FUNCTION
DEFPARAMETER *** ***
DEFSTRUCT FIND-CLASS ENSURE-CLASS
DEFUN FDEFINITION * (SETF FDEFINITION) *
DEFVAR *** ***
* Assuming proposal FUNCTION-NAME:LARGE.
** Does not currently take an environment argument.
*** Functions for SPECIAL proclamations would supply these (see below).
TYPEP and SUBTYPEP also need environment arguments, for reasons which were
discussed on the mailing list in January.
DEFPACKAGE has FIND-PACKAGE and MAKE-PACKAGE as its accessor and updator, but
no local vs remote distinction is currently specified.
Many compilers treat PROCLAIM specially when it appears at top level (not doing
so seriously reduces the utility of proclamations). I think such treatment
ought to be made official, though possibly through the use of a macro, as is
being proposed for IN-PACKAGE => SELECT-PACKAGE. If we do so, the various
declarations that are allowed by proclaim might also need functions.
Note that none of these has an accessor defined in CLtL, and the only
create/update function defined in CLtL is PROCLAIM, which does not take an
environment argument. Note that SEA-2 does not deal with all of these.
FUNCTION yes (by transformation to FTYPE)
Perhaps an AUGMENT-GLOBAL-ENVIRONMENT function needs to be added to SEA, to
record proclamations? I think that such a function, combined with the accessor
functions in SEA would deal with DEFVAR and DEFPARAMETER, assuming that it is
never interesting to know that a variable is proclaimed special, rather than
either proclaimed or declared special (and similarly for type, ftype, and
lexical (if needed due to PROCLAIM-LEXICAL)).