[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Working Around for cl-count
From: |
Dmitry Gutov |
Subject: |
Re: Working Around for cl-count |
Date: |
Sat, 01 Dec 2012 07:21:20 +0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (windows-nt) |
"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.
- Working Around for cl-count, Eric James Michael Ritz, 2012/11/29
- RE: Working Around for cl-count, Drew Adams, 2012/11/29
- Message not available
- Re: Working Around for cl-count, Stefan Monnier, 2012/11/29
- RE: Working Around for cl-count, Drew Adams, 2012/11/29
- Re: Working Around for cl-count, Dmitry Gutov, 2012/11/29
- RE: Working Around for cl-count, Drew Adams, 2012/11/29
- Re: Working Around for cl-count, Dmitry Gutov, 2012/11/29
- Re: Working Around for cl-count, Stefan Monnier, 2012/11/29
- RE: Working Around for cl-count, Drew Adams, 2012/11/29
- Message not available
- Re: Working Around for cl-count, WJ, 2012/11/30
- Re: Working Around for cl-count,
Dmitry Gutov <=
- Message not available
- Re: Working Around for cl-count, Stefan Monnier, 2012/11/29