unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master f225011: ibuffer-do-isearch: don't depend on `cl-values-list' (bug#38430)
       [not found] ` <20191201091358.11752207E0@vcs0.savannah.gnu.org>
@ 2019-12-01 18:29   ` Stefan Monnier
  2019-12-01 23:36     ` Juanma Barranquero
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Monnier @ 2019-12-01 18:29 UTC (permalink / raw)
  To: emacs-devel; +Cc: Juanma Barranquero

>  	  (cl-multiple-value-bind (hip-crowd lamers)
> -	      (cl-values-list
> -	       (ibuffer-split-list (lambda (bufmark)
> -				     (ibuffer-included-in-filters-p (car bufmark)
> -								    filterset))
> -				   bmarklist))
> +	      (ibuffer-split-list (lambda (bufmark)
> +				    (ibuffer-included-in-filters-p (car bufmark)
> +								   filterset))
> +				  bmarklist)

This is "broken" in the sense that it makes assumptions about how the
"multiple values" are implemented.

We do know that `ibuffer-split-list` returns a list, so there's no point
going through CL's multiple-values simulation.  We should instead treat
it as a list and extract the elements with `pcase-let`
(or `cl-destructuring-bind`).


        Stefan




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: master f225011: ibuffer-do-isearch: don't depend on `cl-values-list' (bug#38430)
  2019-12-01 18:29   ` master f225011: ibuffer-do-isearch: don't depend on `cl-values-list' (bug#38430) Stefan Monnier
@ 2019-12-01 23:36     ` Juanma Barranquero
  2019-12-02  0:39       ` Juanma Barranquero
  2019-12-02  1:55       ` Stefan Monnier
  0 siblings, 2 replies; 11+ messages in thread
From: Juanma Barranquero @ 2019-12-01 23:36 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Emacs developers

[-- Attachment #1: Type: text/plain, Size: 639 bytes --]

On Sun, Dec 1, 2019 at 7:29 PM Stefan Monnier <monnier@iro.umontreal.ca>
wrote:

> This is "broken" in the sense that it makes assumptions about how the
> "multiple values" are implemented.

Yes, though we've had that implementation for decades and we're not likely
going to add true multiple values to elisp.

> We do know that `ibuffer-split-list` returns a list, so there's no point
> going through CL's multiple-values simulation.  We should instead treat
> it as a list and extract the elements with `pcase-let`
> (or `cl-destructuring-bind`).

I tried to do a minimal fix so close to branching for 27, but I can do that
if you want.

[-- Attachment #2: Type: text/html, Size: 870 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: master f225011: ibuffer-do-isearch: don't depend on `cl-values-list' (bug#38430)
  2019-12-01 23:36     ` Juanma Barranquero
@ 2019-12-02  0:39       ` Juanma Barranquero
  2019-12-02  1:55       ` Stefan Monnier
  1 sibling, 0 replies; 11+ messages in thread
From: Juanma Barranquero @ 2019-12-02  0:39 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Emacs developers

[-- Attachment #1: Type: text/plain, Size: 51 bytes --]

Pushed as 9c0ac88199accb4133d9fbf36d3c4adc3705b22f

[-- Attachment #2: Type: text/html, Size: 74 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: master f225011: ibuffer-do-isearch: don't depend on `cl-values-list' (bug#38430)
  2019-12-01 23:36     ` Juanma Barranquero
  2019-12-02  0:39       ` Juanma Barranquero
@ 2019-12-02  1:55       ` Stefan Monnier
  2019-12-02  2:20         ` Juanma Barranquero
  1 sibling, 1 reply; 11+ messages in thread
From: Stefan Monnier @ 2019-12-02  1:55 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: Emacs developers

>> This is "broken" in the sense that it makes assumptions about how the
>> "multiple values" are implemented.
> Yes, though we've had that implementation for decades and we're not likely
> going to add true multiple values to elisp.

I must admit I'm biased: I find c-lib's multiple-value support to be
completely worthless.  I don't know anything you can do with that you
can't do just as easily without it.  IOW it only makes sense as
a "compatibility with Common-Lisp", yet it doesn't provide the right
semantics either so it doesn't work for that either.

I regret not having noticed it back in Emacs-24 time when I could have
marked those functions as obsolete (or even kept them in cl.el but not
in cl-lib.el).

>> We do know that `ibuffer-split-list` returns a list, so there's no point
>> going through CL's multiple-values simulation.  We should instead treat
>> it as a list and extract the elements with `pcase-let`
>> (or `cl-destructuring-bind`).
> I tried to do a minimal fix so close to branching for 27, but I can do that
> if you want.

I consider the patch you showed as broken (regardless of whether it
does work in practice, obviously).  Require cl-lib is another way to fix
this, if you want a less intrusive patch.  But we're still "before
branching", so I wouldn't worry about intrusiveness yet.


        Stefan




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: master f225011: ibuffer-do-isearch: don't depend on `cl-values-list' (bug#38430)
  2019-12-02  1:55       ` Stefan Monnier
@ 2019-12-02  2:20         ` Juanma Barranquero
  2019-12-02  3:40           ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Juanma Barranquero @ 2019-12-02  2:20 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Emacs developers

[-- Attachment #1: Type: text/plain, Size: 1660 bytes --]

On Mon, Dec 2, 2019 at 2:55 AM Stefan Monnier <monnier@iro.umontreal.ca>
wrote:

> I must admit I'm biased: I find c-lib's multiple-value support to be
> completely worthless.  I don't know anything you can do with that you
> can't do just as easily without it.  IOW it only makes sense as
> a "compatibility with Common-Lisp", yet it doesn't provide the right
> semantics either so it doesn't work for that either.
>
> I regret not having noticed it back in Emacs-24 time when I could have
> marked those functions as obsolete (or even kept them in cl.el but not
> in cl-lib.el).

I think we should mark them as obsolete and work to remove them some day.
They add clutter with no real benefit. It's silly to have compatibility
with such a feature while we aren't compatible with other useful features
of Common Lisp, like namespaces (I mean, "packages") or format.

> I consider the patch you showed as broken (regardless of whether it
> does work in practice, obviously).  Require cl-lib is another way to fix
> this, if you want a less intrusive patch.

I've commited a fix with cl-destructuring-bind. This is a case where cl
functions (cl-multiple-value-bind and cl-values-list) didn't add anything
of value (no pun intended).

Once we branch, we could perhaps try using more cl and not less. Not just
in that case, but using cl functions instead of reimplementing them here
and there.

I mean,

  (ibuffer-remove-alist 'key alist) == (cl-remove 'key alist :key #'car)

and ibuffer-remove-duplicates is just a reimplementation of
cl-remove-duplicates, without the bells and whistles.

*But*, I think we should have in place a definite policy about cl-lib.

[-- Attachment #2: Type: text/html, Size: 2876 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: master f225011: ibuffer-do-isearch: don't depend on `cl-values-list' (bug#38430)
  2019-12-02  2:20         ` Juanma Barranquero
@ 2019-12-02  3:40           ` Eli Zaretskii
  2019-12-02  3:43             ` Juanma Barranquero
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2019-12-02  3:40 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: monnier, emacs-devel

> From: Juanma Barranquero <lekktu@gmail.com>
> Date: Mon, 2 Dec 2019 03:20:31 +0100
> Cc: Emacs developers <emacs-devel@gnu.org>
> 
> *But*, I think we should have in place a definite policy about cl-lib.

We do.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: master f225011: ibuffer-do-isearch: don't depend on `cl-values-list' (bug#38430)
  2019-12-02  3:40           ` Eli Zaretskii
@ 2019-12-02  3:43             ` Juanma Barranquero
  2019-12-02 15:38               ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Juanma Barranquero @ 2019-12-02  3:43 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Stefan Monnier, Emacs developers

[-- Attachment #1: Type: text/plain, Size: 105 bytes --]

On Mon, Dec 2, 2019 at 4:40 AM Eli Zaretskii <eliz@gnu.org> wrote:

> We do.

Care to elaborate, please?

[-- Attachment #2: Type: text/html, Size: 225 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: master f225011: ibuffer-do-isearch: don't depend on `cl-values-list' (bug#38430)
  2019-12-02  3:43             ` Juanma Barranquero
@ 2019-12-02 15:38               ` Eli Zaretskii
  2019-12-02 17:18                 ` Juanma Barranquero
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2019-12-02 15:38 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: monnier, emacs-devel

> From: Juanma Barranquero <lekktu@gmail.com>
> Date: Mon, 2 Dec 2019 04:43:00 +0100
> Cc: Stefan Monnier <monnier@iro.umontreal.ca>, Emacs developers <emacs-devel@gnu.org>
> 
> Care to elaborate, please?

Yes, we don't preload packages just because it's convenient.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: master f225011: ibuffer-do-isearch: don't depend on `cl-values-list' (bug#38430)
  2019-12-02 15:38               ` Eli Zaretskii
@ 2019-12-02 17:18                 ` Juanma Barranquero
  2019-12-02 17:40                   ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Juanma Barranquero @ 2019-12-02 17:18 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Stefan Monnier, Emacs developers

[-- Attachment #1: Type: text/plain, Size: 457 bytes --]

On Mon, Dec 2, 2019 at 4:38 PM Eli Zaretskii <eliz@gnu.org> wrote:

> Yes, we don't preload packages just because it's convenient.

Oh, well, sorry I was unclear. I was not asking about that. I said that IMO
we should preload cl-lib, but I know that's... unwanted.

What I'm really asking is what is our stance regarding using cl-lib in
lisp/*. I mean, are we trying to minimize run-time dependencies on cl-lib,
or it is ok to use freely?

TIA,

    Juanma

[-- Attachment #2: Type: text/html, Size: 656 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: master f225011: ibuffer-do-isearch: don't depend on `cl-values-list' (bug#38430)
  2019-12-02 17:18                 ` Juanma Barranquero
@ 2019-12-02 17:40                   ` Eli Zaretskii
  2019-12-02 18:10                     ` Juanma Barranquero
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2019-12-02 17:40 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: monnier, emacs-devel

> From: Juanma Barranquero <lekktu@gmail.com>
> Date: Mon, 2 Dec 2019 18:18:35 +0100
> Cc: Stefan Monnier <monnier@iro.umontreal.ca>, Emacs developers <emacs-devel@gnu.org>
> 
> What I'm really asking is what is our stance regarding using cl-lib in lisp/*. I mean, are we trying to minimize
> run-time dependencies on cl-lib, or it is ok to use freely?

It's OK to use cl-lib.  It's cl that we don't want (and the byte
compiler will warn about its use at runtime).



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: master f225011: ibuffer-do-isearch: don't depend on `cl-values-list' (bug#38430)
  2019-12-02 17:40                   ` Eli Zaretskii
@ 2019-12-02 18:10                     ` Juanma Barranquero
  0 siblings, 0 replies; 11+ messages in thread
From: Juanma Barranquero @ 2019-12-02 18:10 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Stefan Monnier, Emacs developers

[-- Attachment #1: Type: text/plain, Size: 150 bytes --]

On Mon, Dec 2, 2019 at 6:40 PM Eli Zaretskii <eliz@gnu.org> wrote:

> It's OK to use cl-lib.

Great.

> It's cl that we don't want

Yep, cl is gross.

[-- Attachment #2: Type: text/html, Size: 340 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-12-02 18:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20191201091356.26612.95511@vcs0.savannah.gnu.org>
     [not found] ` <20191201091358.11752207E0@vcs0.savannah.gnu.org>
2019-12-01 18:29   ` master f225011: ibuffer-do-isearch: don't depend on `cl-values-list' (bug#38430) Stefan Monnier
2019-12-01 23:36     ` Juanma Barranquero
2019-12-02  0:39       ` Juanma Barranquero
2019-12-02  1:55       ` Stefan Monnier
2019-12-02  2:20         ` Juanma Barranquero
2019-12-02  3:40           ` Eli Zaretskii
2019-12-02  3:43             ` Juanma Barranquero
2019-12-02 15:38               ` Eli Zaretskii
2019-12-02 17:18                 ` Juanma Barranquero
2019-12-02 17:40                   ` Eli Zaretskii
2019-12-02 18:10                     ` Juanma Barranquero

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).