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

DEFSUBST and &REST



In System 78.51, ...

Consider:

  (DEFSUBST SYMBOLCONC (&REST X)
    (INTERN (LEXPR-FUNCALL #'STRING-APPEND X)))

Calls to SYMBOLCONC run fine interpreted and die when you try 
to macroexpand them. I don't seen any reason that

  (SYMBOLCONC X Y Z)

couldn't macroexpand to

  (INTERN (LEXPR-FUNCALL #'STRING-APPEND (LIST X Y Z))).

or

  (LET ((G0001 (LIST X Y Z))) ;must be a real Gensym or nested defsubst calls lose
    (INTERN (LEXPR-FUNCALL #'STRING-APPEND G0001)))

It would be a bit CONS-inefficient (unless LEXPR-FUNCALL optimized this
case, of course, which it probably should but that's another issue...),
but semantically no less correct than the other things DEFSUBST does.

In any case, if you aren't going to go to this trouble, then &REST should
not be valid in DEFSUBST arglists and should be diagnosed at DEFSUBST time
rather than sitting around as time bombs waiting to lose.

-kmp