emacs-devel
[Top][All Lists]
Advanced

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

Re: un-deprecating CL


From: David O'Toole
Subject: Re: un-deprecating CL
Date: Mon, 17 Sep 2007 00:35:28 -0400
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/23.0.50 (gnu/linux)

Richard Stallman <address@hidden> writes:

> destructuring-bind is ok to add, because it is simple and modular.
> Likewise `case' and `typecase'.
>
> I don't want to add CL argument lists, so no `function*' or `defun*'.

Destructuring-bind supports most of the CL argument list stuff,
including keyword arguments; this makes it simple to implement
functions that take keyword arguments, and might encourage people to
do so.

> I don't want to add `union' or `intersection' or `set-difference' or
> `subst' or `sort*' or `delete*', because they use CL keyword
> arguments.

--snip--

> `every', `substitute', `find' and `subsetp' have the ugly CL keyword
> arguments, so I don't want to add them.

It isn't clear to me what exactly is so bad about keyword arguments,
or what alternative (if any) you have in mind for dealing sensibly
with functions accepting more than one or two optional arguments. When
you want to supply `x' as just one of the optional arguments to a
function that takes several, and the one you want to supply happens
not to be the first, you end up writing things like 

(foo bar nil nil nil x)

I cringe when I have to do this. Furthermore, if the defaults are not
`nil' then you also have to look up what are acceptable values to pass
for the arguments that you did not want to specify in the first
place. For example, `make-hash-table' would arguably be harder to use
if did not employ keyword arguments, of which it takes five---and
several of the defaults are non-nil.

Speaking of which, why is it ok for a frequently-used built-in
function like make-hash-table to use keyword arguments in the first
place?

> Adding `setf' really means adding `defstruct'.  That might be a good
> feature to add, but it is too complex because of all the structure
> options.  If we get rid of most of them, `defstruct' could be simple
> enough to add.

I don't understand---defstruct is already implemented in the CL
package. Are you talking about copying that definition, removing many
of the options, and then pasting it somewhere else?

-- 
David O'Toole 
address@hidden
http://dto.freeshell.org/notebook/





reply via email to

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