opensubscriber
   Find in this group all groups
 
Unknown more information…

e : emacs-devel@gnu.org 10 June 2012 • 8:53PM -0400

Re: Replacement for `aput' from obsolete assoc.el?
by Stephen J. Turnbull

REPLY TO AUTHOR
 
REPLY TO GROUP




Vitalie Spinu writes:

> There is no way to associate multiple values at once. What is the
> canonical way to do that?

I don't see such a great need for it.  The loop idiom you propose is
fine (except that I suppose in GNU Emacs you need to use `cl-loop', at
least in core).  In XEmacs, the canonical destructive idiom is

    (setq plist (canonicalize-lax-plist (nconc plist-new plist)))

which gives preference to entries in plist-new, and would be more
efficient (all of the functions are primitives implemented in C).

> I find reasonable that this sort of functionality be in the core for all
> available containers.

Reasonable, in some sense, yes.  That probably would pass in Common
Lisp, but as you're probably aware Emacs Lisp prefers simplicity over
generality for generality's sake.



Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.