[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Structures in MacLISP



    Date: 6 November 1980 01:25-EST
    From: Tom Trobaugh <TFT at MIT-AI>
    How do I get defstructs in MACLISP?  MACLISP used to understand
    LISPM2;NSTRUC, but seems to have lost some of the relevant vocabulary.
The autoloading MacLISP feature DEFVST (documented in LISP:DEFVST DOC)
is the MacLISP/NIL way to get structures; by making two "switch setting"
adjustments you can cause it to behave pretty much they way the  LISPM
documented DEFSTRUCT works (LISPM manual P. 147); just do 
 (SETQ CONSTRUCTOR-NAMESTRING-PREFIX '|MAKE-|  SELECTOR-NAMESTRING-STYLE () )
The "LDB"-style fields, as in item "(3)", Page 147 of LISPM Manual, are
not yet implemented, but will be sooner or later.  Of course, some of the 
many LISPM options are inherently non-NIL/non-MacLISP, such as :GROUPED-ARRAY,
but otherwise the syntax is the same.  
   DEFVST produces hunk-type objects, which fit into the CLASS system
if that is loaded (see LISP;LISP RECENT), but if not loaded they just
remain MacLISP hunks.  Since DEFVST isn't intended to be totally 100%
compatible with DEFSTRUCT, it isn't named that, but you could conditionally
do the switch settings mentioned above and macro-define DEFSTRUCT just
to turn into DEFVST, and probably win in most cases.