[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Structures in MacLISP
- To: TFT at MIT-MC
- Subject: Structures in MacLISP
- From: JONL at MIT-MC (Jon L White)
- Date: Thu, 6 Nov 80 23:45:00 GMT
- Cc: (BUG LISP) at MIT-MC
- Original-date: 6 NOV 1980 1845-EST
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.