all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Working Around for cl-count
@ 2012-11-29 16:06 Eric James Michael Ritz
  2012-11-29 17:54 ` Drew Adams
       [not found] ` <mailman.14064.1354211666.855.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 14+ messages in thread
From: Eric James Michael Ritz @ 2012-11-29 16:06 UTC (permalink / raw)
  To: gnu-emacs-help

[-- Attachment #1: Type: text/html, Size: 6551 bytes --]

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

* RE: Working Around for cl-count
  2012-11-29 16:06 Working Around for cl-count Eric James Michael Ritz
@ 2012-11-29 17:54 ` Drew Adams
       [not found] ` <mailman.14064.1354211666.855.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 14+ messages in thread
From: Drew Adams @ 2012-11-29 17:54 UTC (permalink / raw)
  To: 'Eric James Michael Ritz', gnu-emacs-help

> Versions of Emacs less than version 24.2 complain about the lack of
> `cl-count`.

In older versions, `cl-count' is called `count'.
Use something like this:

(if (fboundp 'cl-count) #'cl-count #'count)




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

* Re: Working Around for cl-count
       [not found] ` <mailman.14064.1354211666.855.help-gnu-emacs@gnu.org>
@ 2012-11-29 18:34   ` Stefan Monnier
  2012-11-29 18:45     ` Drew Adams
       [not found]     ` <mailman.14071.1354214747.855.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 14+ messages in thread
From: Stefan Monnier @ 2012-11-29 18:34 UTC (permalink / raw)
  To: help-gnu-emacs

>> Versions of Emacs less than version 24.2 complain about the lack of
>> `cl-count`.
> In older versions, `cl-count' is called `count'.
> Use something like this:
> (if (fboundp 'cl-count) #'cl-count #'count)

Or use the `cl-lib' package that's on GNU ELPA.


        Stefan


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

* RE: Working Around for cl-count
  2012-11-29 18:34   ` Stefan Monnier
@ 2012-11-29 18:45     ` Drew Adams
  2012-11-29 19:51       ` Dmitry Gutov
       [not found]     ` <mailman.14071.1354214747.855.help-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 14+ messages in thread
From: Drew Adams @ 2012-11-29 18:45 UTC (permalink / raw)
  To: 'Stefan Monnier', help-gnu-emacs

> >> Versions of Emacs less than version 24.2 complain about the lack of
> >> `cl-count`.
> >
> > In older versions, `cl-count' is called `count'.
> > Use something like this:
> > (if (fboundp 'cl-count) #'cl-count #'count)
> 
> Or use the `cl-lib' package that's on GNU ELPA.

You can't do that if your code that calls `cl-count' is used by others.

What are you going to do?  Tell users of your code who have Emacs < 24.2 that
they must download `cl-lib' from GNU ELPA and put it in their `load-path'?  Or
download it yourself and bundle that package with your code?




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

* Re: Working Around for cl-count
       [not found]     ` <mailman.14071.1354214747.855.help-gnu-emacs@gnu.org>
@ 2012-11-29 19:51       ` Stefan Monnier
  0 siblings, 0 replies; 14+ messages in thread
From: Stefan Monnier @ 2012-11-29 19:51 UTC (permalink / raw)
  To: help-gnu-emacs

> What are you going to do?  Tell users of your code who have Emacs < 24.2 that
> they must download `cl-lib' from GNU ELPA and put it in their
> `load-path'?

Yes.


        Stefan


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

* Re: Working Around for cl-count
  2012-11-29 18:45     ` Drew Adams
@ 2012-11-29 19:51       ` Dmitry Gutov
  2012-11-29 20:47         ` Drew Adams
  0 siblings, 1 reply; 14+ messages in thread
From: Dmitry Gutov @ 2012-11-29 19:51 UTC (permalink / raw)
  To: Drew Adams; +Cc: help-gnu-emacs, 'Stefan Monnier'

"Drew Adams" <drew.adams@oracle.com> writes:

>> >> Versions of Emacs less than version 24.2 complain about the lack of
>> >> `cl-count`.
>> >
>> > In older versions, `cl-count' is called `count'.
>> > Use something like this:
>> > (if (fboundp 'cl-count) #'cl-count #'count)
>> 
>> Or use the `cl-lib' package that's on GNU ELPA.
>
> You can't do that if your code that calls `cl-count' is used by others.
>
> What are you going to do?  Tell users of your code who have Emacs < 24.2 that
> they must download `cl-lib' from GNU ELPA and put it in their `load-path'?  Or
> download it yourself and bundle that package with your code?

You publish your code as package to one of the ELPA repositories and add
"cl-lib" as one of the dependencies.



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

* RE: Working Around for cl-count
  2012-11-29 19:51       ` Dmitry Gutov
@ 2012-11-29 20:47         ` Drew Adams
  2012-11-29 21:01           ` Dmitry Gutov
                             ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Drew Adams @ 2012-11-29 20:47 UTC (permalink / raw)
  To: 'Dmitry Gutov'; +Cc: help-gnu-emacs, 'Stefan Monnier'

> >> >> Versions of Emacs less than version 24.2 complain about 
> >> >> the lack of `cl-count`.
> >> >
> >> > In older versions, `cl-count' is called `count'.
> >> > Use something like this:
> >> > (if (fboundp 'cl-count) #'cl-count #'count)
> >> 
> >> Or use the `cl-lib' package that's on GNU ELPA.
> >
> > You can't do that if your code that calls `cl-count' is 
> > used by others.
> >
> > What are you going to do?  Tell users of your code who have 
> > Emacs < 24.2 that they must download `cl-lib' from GNU ELPA
> > and put it in their `load-path'?  Or download it yourself
> > and bundle that package with your code?
> 
> You publish your code as package to one of the ELPA 
> repositories and add "cl-lib" as one of the dependencies.

So instead of fixing this at the source-code level, with just a few chars of
Lisp, you try to solve the problem at the distribution level: "Just use GNU
ELPA".

Have hammer, will see nails...




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

* Re: Working Around for cl-count
  2012-11-29 20:47         ` Drew Adams
@ 2012-11-29 21:01           ` Dmitry Gutov
  2012-11-30  1:00           ` Stefan Monnier
       [not found]           ` <mailman.14089.1354222890.855.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 14+ messages in thread
From: Dmitry Gutov @ 2012-11-29 21:01 UTC (permalink / raw)
  To: Drew Adams; +Cc: help-gnu-emacs, 'Stefan Monnier'

"Drew Adams" <drew.adams@oracle.com> writes:

>> >> >> Versions of Emacs less than version 24.2 complain about 
>> >> >> the lack of `cl-count`.
>> >> >
>> >> > In older versions, `cl-count' is called `count'.
>> >> > Use something like this:
>> >> > (if (fboundp 'cl-count) #'cl-count #'count)
>> >> 
>> >> Or use the `cl-lib' package that's on GNU ELPA.
>> >
>> > You can't do that if your code that calls `cl-count' is 
>> > used by others.
>> >
>> > What are you going to do?  Tell users of your code who have 
>> > Emacs < 24.2 that they must download `cl-lib' from GNU ELPA
>> > and put it in their `load-path'?  Or download it yourself
>> > and bundle that package with your code?
>> 
>> You publish your code as package to one of the ELPA 
>> repositories and add "cl-lib" as one of the dependencies.
>
> So instead of fixing this at the source-code level, with just a few chars of
> Lisp, you try to solve the problem at the distribution level: "Just use GNU
> ELPA".
>
> Have hammer, will see nails...

You can use whatever workaround you want, but obviously the shim cl-lib
published at GNU ELPA is targeted at packages already present in or
indented for ELPA.



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

* Re: Working Around for cl-count
  2012-11-29 20:47         ` Drew Adams
  2012-11-29 21:01           ` Dmitry Gutov
@ 2012-11-30  1:00           ` Stefan Monnier
  2012-11-30  1:33             ` Drew Adams
       [not found]           ` <mailman.14089.1354222890.855.help-gnu-emacs@gnu.org>
  2 siblings, 1 reply; 14+ messages in thread
From: Stefan Monnier @ 2012-11-30  1:00 UTC (permalink / raw)
  To: Drew Adams; +Cc: help-gnu-emacs

> So instead of fixing this at the source-code level, with just a few chars of
> Lisp, you try to solve the problem at the distribution level: "Just use GNU
> ELPA".
> Have hammer, will see nails...

I just proposed an alternate route.  Depending on the circumstances it
might be a good idea, or not.

If you find it entertaining to push the idea far enough that it
becomes absurd, all the more power to you,


        Stefan



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

* RE: Working Around for cl-count
  2012-11-30  1:00           ` Stefan Monnier
@ 2012-11-30  1:33             ` Drew Adams
  0 siblings, 0 replies; 14+ messages in thread
From: Drew Adams @ 2012-11-30  1:33 UTC (permalink / raw)
  To: 'Stefan Monnier'; +Cc: help-gnu-emacs

> > So instead of fixing this at the source-code level, with 
> > just a few chars of Lisp, you try to solve the problem at
> > the distribution level: "Just use GNU ELPA".
> > Have hammer, will see nails...
> 
> I just proposed an alternate route.  Depending on the
> circumstances it might be a good idea, or not.
> 
> If you find it entertaining to push the idea far enough that it
> becomes absurd, all the more power to you,

Actually, the reply you quote from me was to a different proposal from yours.
So you're off-base here.

You did not propose that the OP publish his code on GNU ELPA and add a
dependency on `cl-lib' at that level.  You proposed telling the OP's users to
download `cl-lib' themselves and include it in their own `load-path' values.

And where is the exaggeration in what I wrote?  Isn't that just what Dmitry's
suggestion was: for the OP to distribute his code on GNU ELPA, where it could
reference `cl-lib'?

And no, I am not trying to entertain anyone.  I truly believe that a local
source-code change that adds only a few chars is a better solution, in general,
than either (a) telling the OP's users to download and reference `cl-lib'
themselves (your proposal) or (b) uploading the OP's code to GNU ELPA and
pointing it to `cl-lib' (Dmitry's proposal).

We can agree to disagree, but let's please assume that we each believe that our
suggestion has some merit and might help - alternate routes, as you say.




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

* Re: Working Around for cl-count
       [not found]           ` <mailman.14089.1354222890.855.help-gnu-emacs@gnu.org>
@ 2012-12-01  1:20             ` WJ
  2012-12-01  3:21               ` Dmitry Gutov
       [not found]               ` <mailman.14221.1354332086.855.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 14+ messages in thread
From: WJ @ 2012-12-01  1:20 UTC (permalink / raw)
  To: help-gnu-emacs

Dmitry Gutov wrote:

> "Drew Adams" <drew.adams@oracle.com> writes:
> 
> >> >> >> Versions of Emacs less than version 24.2 complain about 
> >> >> >> the lack of `cl-count`.
> >> >> >
> >> >> > In older versions, `cl-count' is called `count'.
> >> >> > Use something like this:
> >> >> > (if (fboundp 'cl-count) #'cl-count #'count)
> >> >> 
> >> >> Or use the `cl-lib' package that's on GNU ELPA.
> >> >
> >> > You can't do that if your code that calls `cl-count' is 
> >> > used by others.
> >> >
> >> > What are you going to do?  Tell users of your code who have 
> >> > Emacs < 24.2 that they must download `cl-lib' from GNU ELPA
> >> > and put it in their `load-path'?  Or download it yourself
> >> > and bundle that package with your code?
> >> 
> >> You publish your code as package to one of the ELPA 
> >> repositories and add "cl-lib" as one of the dependencies.
> > 
> > So instead of fixing this at the source-code level, with just a few chars of
> > Lisp, you try to solve the problem at the distribution level: "Just use GNU
> > ELPA".
> > 
> > Have hammer, will see nails...
> 
> You can use whatever workaround you want, but obviously the shim cl-lib
> published at GNU ELPA is targeted at packages already present in or
> indented for ELPA.

: (version)
"GNU Emacs 23.4.1 (i386-mingw-nt5.1.2600)
 of 2012-02-04 on MARVIN"
: (require 'cl)
: (count 2 (number-sequence 1 22) :key (apply-partially 'gcd 4))
6


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

* Re: Working Around for cl-count
  2012-12-01  1:20             ` WJ
@ 2012-12-01  3:21               ` Dmitry Gutov
  2012-12-01  6:48                 ` Drew Adams
       [not found]               ` <mailman.14221.1354332086.855.help-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 14+ messages in thread
From: Dmitry Gutov @ 2012-12-01  3:21 UTC (permalink / raw)
  To: WJ; +Cc: help-gnu-emacs

"WJ" <w_a_x_man@yahoo.com> writes:

> Dmitry Gutov wrote:
>
>> "Drew Adams" <drew.adams@oracle.com> writes:
>> 
>> >> >> >> Versions of Emacs less than version 24.2 complain about 
>> >> >> >> the lack of `cl-count`.
>> >> >> >
>> >> >> > In older versions, `cl-count' is called `count'.
>> >> >> > Use something like this:
>> >> >> > (if (fboundp 'cl-count) #'cl-count #'count)
>> >> >> 
>> >> >> Or use the `cl-lib' package that's on GNU ELPA.
>> >> >
>> >> > You can't do that if your code that calls `cl-count' is 
>> >> > used by others.
>> >> >
>> >> > What are you going to do?  Tell users of your code who have 
>> >> > Emacs < 24.2 that they must download `cl-lib' from GNU ELPA
>> >> > and put it in their `load-path'?  Or download it yourself
>> >> > and bundle that package with your code?
>> >> 
>> >> You publish your code as package to one of the ELPA 
>> >> repositories and add "cl-lib" as one of the dependencies.
>> > 
>> > So instead of fixing this at the source-code level, with just a few chars of
>> > Lisp, you try to solve the problem at the distribution level: "Just use GNU
>> > ELPA".
>> > 
>> > Have hammer, will see nails...
>> 
>> You can use whatever workaround you want, but obviously the shim cl-lib
>> published at GNU ELPA is targeted at packages already present in or
>> indented for ELPA.
>
> : (version)
> "GNU Emacs 23.4.1 (i386-mingw-nt5.1.2600)
>  of 2012-02-04 on MARVIN"
> : (require 'cl)
> : (count 2 (number-sequence 1 22) :key (apply-partially 'gcd 4))
> 6

Yes, it works. Using unprefixed cl functions is all sorts of deprecated,
though, hence the recommendation.



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

* RE: Working Around for cl-count
  2012-12-01  3:21               ` Dmitry Gutov
@ 2012-12-01  6:48                 ` Drew Adams
  0 siblings, 0 replies; 14+ messages in thread
From: Drew Adams @ 2012-12-01  6:48 UTC (permalink / raw)
  To: 'Dmitry Gutov', 'WJ'; +Cc: help-gnu-emacs

> > "GNU Emacs 23.4.1 (i386-mingw-nt5.1.2600)
> > : (count 2 (number-sequence 1 22)
> >          :key (apply-partially 'gcd 4))
> > 6
> 
> Yes, it works.  Using unprefixed cl functions is
> is all sorts of deprecated, though, hence the recommendation.
  ^^^^^^^^^^^^^^^^^^^^^^^^^^

I'm not sure exactly what WJ's point is, but NO, `count' is not at all
deprecated in Emacs 23.4, the version that WJ shows.

It is not even deprecated in 24.1 or 24.2!

`cl-lib.el', hence `cl-count', does not even exist yet, in any Emacs release!
It is being declared deprecated in the current pretest version of Emacs, which
will lead to release 24.3.

There is nothing wrong with thinking ahead.  But the OP made clear that his code
is intended for multiple Emacs versions (presumably including future releases),
and there is not yet ANY released version where `cl-count' even exists.  And WJ
specifically noted use of release 23.4.




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

* Re: Working Around for cl-count
       [not found]               ` <mailman.14221.1354332086.855.help-gnu-emacs@gnu.org>
@ 2012-12-01  7:12                 ` Helmut Eller
  0 siblings, 0 replies; 14+ messages in thread
From: Helmut Eller @ 2012-12-01  7:12 UTC (permalink / raw)
  To: help-gnu-emacs

On Sat, Dec 01 2012, Dmitry Gutov wrote:

> Yes, it works. Using unprefixed cl functions is all sorts of deprecated,
> though, hence the recommendation.

Who recommends that?  The thought police? 

Helmut


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

end of thread, other threads:[~2012-12-01  7:12 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-29 16:06 Working Around for cl-count Eric James Michael Ritz
2012-11-29 17:54 ` Drew Adams
     [not found] ` <mailman.14064.1354211666.855.help-gnu-emacs@gnu.org>
2012-11-29 18:34   ` Stefan Monnier
2012-11-29 18:45     ` Drew Adams
2012-11-29 19:51       ` Dmitry Gutov
2012-11-29 20:47         ` Drew Adams
2012-11-29 21:01           ` Dmitry Gutov
2012-11-30  1:00           ` Stefan Monnier
2012-11-30  1:33             ` Drew Adams
     [not found]           ` <mailman.14089.1354222890.855.help-gnu-emacs@gnu.org>
2012-12-01  1:20             ` WJ
2012-12-01  3:21               ` Dmitry Gutov
2012-12-01  6:48                 ` Drew Adams
     [not found]               ` <mailman.14221.1354332086.855.help-gnu-emacs@gnu.org>
2012-12-01  7:12                 ` Helmut Eller
     [not found]     ` <mailman.14071.1354214747.855.help-gnu-emacs@gnu.org>
2012-11-29 19:51       ` Stefan Monnier

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.