perm filename RECORD.MMO[PAT,LMM] blob sn#058042
filedate 1973-08-14 generic text, type T, neo UTF8
I've been thinking about records, as you mentioned them....
what I have in mind is similar to the stuff I did before: viz.
declaration: RECORD( recordname ( record pattern ))
for example, RECORD(FOO (FIE FUM . FIG]
to retrieve a field, one can say X:FIE (CLISP)
this will DWIMIFY to (FIE X) .... the RECORD declaration
will /MOVD (CAR FIE) so that won't cost .... also
put MACRO property on FIE so that it will compile
to create a record:
(FOO FIE = expression
FUM = expression
FUG = expression)
this will translate to the appropriate CONS/LIST thing, but
will remain invisible so that DWIMIFY+CLISPIFY will
get back the same thing.
also valid are:
(FOO FROM expression
FIE = expression)
which will take every field except the FIE field from the
X:FIE←expression ... might DWIMIFY to
(RPLAC.FIE X expression) with the RPLAC.FIE defined & macro'd
Both record names and field names must be unique (i.e., can't
be same as any function name. Record names, when declared, go on
CHANGEDFNSLST & the FILEPKG will need a (RECORD) prettymacro.
Additional possibility: identifiable records.
declare: !RECORD( FOO (FIE FUUM . FIE))
secretly inserts an ID field in front which will contain the atom FOO.
Will also define & macro a function FOO? = (EQ (CAR x) (QUOTE FOO]
1) setting DWIMIFY to
recognize x:field, x:field←...
(even when field is misspelled)
recognize (record [FROM expression] ...), with
spelling correction on field names, = packed in or missing,
and spelling correction on record name
2) setting CLISPIFY to
recognize (fieldname expression)
or (RPLAC.fieldname expression)
3) file package stuff for remembering and saving record definitions..
4) Fixing prettyprint to recognize (record ....) etc (because there
might not be an = between fields)