[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Accepting and returning multiple values in 'cl
From: |
Dave Goel |
Subject: |
Re: Accepting and returning multiple values in 'cl |
Date: |
Thu, 12 Mar 2009 15:57:59 -0400 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) |
> The reason why I'm not sure we should install it, is that I'm afraid
>people got used to the current quirks of MRV, and the quirks of your
>alternative implementations aren't obviously preferable: yes, if we
>started cl.el now, I might choose your code over the current one, but
>I'm not sure it's worth the potential breakage now.
I do see your point. I see a very few places in emacs, but it is
understandable.
Actually, I discovered cl's authors's own cl-compat.el, which is
already in emacs, which already seeks to do the right thing (just what
my cl-multiple.el did), with the alternative names like Values,
Multiple-value-*, etc. I grepped through the whole emacs, nothing
uses these functions.
I see problems with cl-compat though, for example:
My code:
(multiple-value-list
(progn
(values nil)
(values)))
nil
(Multiple-value-list
(progn
(Values nil)
(Values)))
(nil)
^^ that is wrong.
Its implementation is also a bit funny and convoluted. It depends on
cl.el's multiple-value- implementations, which itself is hairy.
Do you mind if I fix these bugs with cl-compat.el and reimplement its
m-v functions? There, I also want to add a note to the user: any time
they use forms that return m- values, the final form should invoke
(Values ) as well.
Keeping with cl-compat's usual terminology, cl-floor* and cl-truncate*
should be defaliased to Floor*, and Truncate*...
It seems like these changes won't affect the rest of emacs at all.