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

Spread Uniformity and Auto-Doc -- your comments



Dave, I'm not sure we're talking about the same issues -- I've marked a ! in
front of the lines with your replies to my comments.

re: Spread Uniformity
    Date: Tue, 31 May 83 21:40 EDT
    From: David A. Moon <Moon%SCRC-TENEX%MIT-MC@SU-DSN.ARPA>
    Subject: Memorial Day Ballot: comments on other people's entries
    To: common-lisp@su-ai.ARPA
      . . . 
        Spread Uniformity:
	    The meaning of a lambda-list for DEFUN, for lambda forms, and
        for DEFMACRO ought to be perceptually the same . . . 
!   I am in very strong disagreement with this.  Functions and special forms
!   are fundamentally different.  "Destructuring" in the lambda list of a
!   function refers to taking apart THE VALUE OF AN ARGUMENT AT RUN
!   TIME.  "Destructuring" in the "lambda" list of a macro refers to taking apart
!   THE SYNTACTIC STRUCTURE OF THE INVOKING FORM AT COMPILE
!   TIME.  These are as different as can be.  

WHAT?  "COMPILE TIME"??  You mean I can't run my macros interpretively
at "run time" in CommonLisp?  Or, have you just overlooked that the
macro expansion function has its own place in the sun, its own "run time".

Seriously, though, the relevant issue is separating out the syntax of function
definition from the reason why, or goal towards which that function is
defined.  It should come as no surprise that  there are functions which do
S-expression to S-expression translations ** and which serve the dual purpose **
of being the support for a named macro in one context, and merely a function
called by some automated code analyzers in another context.  This situation arises
frequently when one writes a translator which "compiles" from a Lisp-like
language into some standard-subset Lisp.  DEFMACRO is merely a succinct way
of saying "assign this function to be the code-expander for that macro".


re: Auto-Documentation
       .  .  .  
	    Especially is this matter of uniformity [for arg-list destructuring]
       important for auto-documentation.  Wouldn't it be nice if you could write
	    (DEFUN FOO ((A B) C) ...)
        rather than
	    (DEFUN FOO (L C) (PROG ((A (CAR L)) (B (CADR L))) ...))
        so that ?= type of helpers would show you more about the syntax
        of input arguments?  
        .  .  .  
	    What a loss if such facility worked for DEFUN definitions, but 
        not for DEFMACRO definitions (and vice-versa)!
!   Of course you can always get the auto-documentation to say anything
!   you like, by using (DECLARE (ARGLIST ...)), at least on the Lisp machine.

No doubt this declaration was inspired by the Interlisp ARGLIST function.  But
surely you don't mean to imply that installing special information "by hand" 
is "automatic" documentation.  Or, maybe you do.   The Interlisp function
SMARTARGLIST goes out and consults an on-line manual, which is fine 
documentation for the system functions at least (or rather, those system
functions for which someone bothered to write manual documentation).