emacs-devel
[Top][All Lists]
Advanced

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

RE: [External] : Re: Declaring Lisp function types


From: Drew Adams
Subject: RE: [External] : Re: Declaring Lisp function types
Date: Sun, 25 Feb 2024 17:16:43 +0000

> > In principle I believe we are interested in expressing the the
> argument
> > types and (maybe optionally) the return type.
> 
> What's missing is the why.  Do we actually want to put function type
> declarations in Lisp source at all?  They will clutter up the code more
> than it is cluttered up at the moment.
> 
> A ground principle of Lisp is that type checking is done at run time,
> not compile time.  Your proposal seems to be changing that, although I
> don't know what the intention for using the type decorations is.
> 
> I worry that these declarations will become frequent, even pervasive,
> and then effectively compulsory.  Then we won't have Lisp any more,
> we'll have something more like C.
> 
> I think somebody said somewhere that the declarations will be
> "voluntary", but things that start off voluntary have a nasty habit of
> first becoming pervasive, then all but universal, and then compulsory.
> 
> As I said, I don't know what these declarations are for, but I think
> serious thought should be given to not implementing them.

Hi Alan,

This comes from Common Lisp (if not older relatives).
Please see this in general, and in particular about
declarations being voluntary, and their purpose(s):

https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node103.html#SECTION001300000000000000000

In particular, the intro paragraph tells us:

 Declarations allow you to specify extra information
 about your program to the Lisp system.  With one
 exception, declarations are completely optional and
 correct declarations do not affect the meaning of a
 correct program. The exception is that special
 declarations do affect the interpretation of variable
 bindings and references and so must be specified
 where appropriate.  All other declarations are of an
 advisory nature, and may be used by the Lisp system
 to aid the programmer by performing extra error
 checking or producing more efficient compiled code.
 Declarations are also a good way to add documentation
 to a program.

Keep in mind that Common Lisp is not a particular
implementation.  It's a spec/standard, which particular
implementations can support/implement in different ways.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]