unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* CL functions called at runtime
@ 2012-12-03 18:55 Burton Samograd
  2012-12-03 19:54 ` Stefan Monnier
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Burton Samograd @ 2012-12-03 18:55 UTC (permalink / raw)
  To: emacs-devel

Hi,

I seemed to have missed the dicussion about the warnings being generated
by the byte compiler about CL functions being called at runtime.  Now
I'm seeing them in my code for useful functions like remove-if.

Could someone explain why these warnings are being generated?

--
Burton Samograd




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

* Re: CL functions called at runtime
  2012-12-03 18:55 CL functions called at runtime Burton Samograd
@ 2012-12-03 19:54 ` Stefan Monnier
  2012-12-03 20:03   ` Burton Samograd
  2012-12-03 19:55 ` Glenn Morris
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 12+ messages in thread
From: Stefan Monnier @ 2012-12-03 19:54 UTC (permalink / raw)
  To: Burton Samograd; +Cc: emacs-devel

> I seemed to have missed the dicussion about the warnings being generated
> by the byte compiler about CL functions being called at runtime.  Now
> I'm seeing them in my code for useful functions like remove-if.
> Could someone explain why these warnings are being generated?

There are different such warnings for different cases, so please specify
precisely what you see,


        Stefan



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

* Re: CL functions called at runtime
  2012-12-03 18:55 CL functions called at runtime Burton Samograd
  2012-12-03 19:54 ` Stefan Monnier
@ 2012-12-03 19:55 ` Glenn Morris
  2012-12-03 20:00   ` Burton Samograd
  2012-12-03 19:56 ` Pascal J. Bourguignon
  2012-12-03 19:59 ` Daniel Colascione
  3 siblings, 1 reply; 12+ messages in thread
From: Glenn Morris @ 2012-12-03 19:55 UTC (permalink / raw)
  To: Burton Samograd; +Cc: emacs-devel

Burton Samograd wrote:

> I seemed to have missed the dicussion about the warnings being generated
> by the byte compiler about CL functions being called at runtime.

Probably because it happened decades ago.

>  Now I'm seeing them in my code for useful functions like remove-if.

They've always been there.

> Could someone explain why these warnings are being generated?

No point repeating ancient history. Search the archives, read the elisp
manual "tips" section; or use cl-lib instead.



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

* Re: CL functions called at runtime
  2012-12-03 18:55 CL functions called at runtime Burton Samograd
  2012-12-03 19:54 ` Stefan Monnier
  2012-12-03 19:55 ` Glenn Morris
@ 2012-12-03 19:56 ` Pascal J. Bourguignon
  2012-12-03 19:59 ` Daniel Colascione
  3 siblings, 0 replies; 12+ messages in thread
From: Pascal J. Bourguignon @ 2012-12-03 19:56 UTC (permalink / raw)
  To: emacs-devel

Burton Samograd <burton@samograd.ca> writes:

> Hi,
>
> I seemed to have missed the dicussion about the warnings being generated
> by the byte compiler about CL functions being called at runtime.  Now
> I'm seeing them in my code for useful functions like remove-if.
>
> Could someone explain why these warnings are being generated?

That's because the functions defined in the file cl.el (and associated
files) are not deemed "pure" emacs lisp enough.  (Is the actual reason
because RMS doesn't like Common Lisp, or because they represent a layer
above emacs lisp and therefore may be slower than native emacs lisp
functions?  Some other reason I don't know?)  It is accepted that they
are used at macro expansion time, in emacs code distributed by the FSF,
but the FSF doesn't want to distribute emacs code that depend on them at
run-time.


Notice however that if you don't have the intention to have your code
integrated with the GNU emacs distribution, then this warning is totally
irrelevant: you can make your code dependant on cl.el as you can make it
dependent on any other emacs package, coming from the FSF or from any
third party.


I have this in my ~/.emacs to disable those warnings:

(require 'bytecomp)
(byte-compile-disable-warning 'cl-functions)


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.




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

* Re: CL functions called at runtime
  2012-12-03 18:55 CL functions called at runtime Burton Samograd
                   ` (2 preceding siblings ...)
  2012-12-03 19:56 ` Pascal J. Bourguignon
@ 2012-12-03 19:59 ` Daniel Colascione
  2012-12-03 20:05   ` Burton Samograd
  2012-12-03 20:21   ` Glenn Morris
  3 siblings, 2 replies; 12+ messages in thread
From: Daniel Colascione @ 2012-12-03 19:59 UTC (permalink / raw)
  To: Burton Samograd; +Cc: emacs-devel

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

On 12/3/12 10:55 AM, Burton Samograd wrote:
> Hi,
> 
> I seemed to have missed the dicussion about the warnings being generated
> by the byte compiler about CL functions being called at runtime.  Now
> I'm seeing them in my code for useful functions like remove-if.

(defadvice byte-compile-warn (around shut-up-about-cl activate compile)
  (let* ((fmt (ad-get-arg 0)))
    (unless (string-match "cl package" fmt)
      ad-do-it)))




[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 235 bytes --]

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

* Re: CL functions called at runtime
  2012-12-03 19:55 ` Glenn Morris
@ 2012-12-03 20:00   ` Burton Samograd
  2012-12-03 20:22     ` Glenn Morris
  0 siblings, 1 reply; 12+ messages in thread
From: Burton Samograd @ 2012-12-03 20:00 UTC (permalink / raw)
  To: Glenn Morris; +Cc: emacs-devel

Glenn Morris <rgm@gnu.org> writes:

> Burton Samograd wrote:
>
>> I seemed to have missed the dicussion about the warnings being generated
>> by the byte compiler about CL functions being called at runtime.
>
> Probably because it happened decades ago.

Ok, I thought these warnings were added more recently.  Maybe I was
thinking of the cl-lib discussion that's been going on.

>
>>  Now I'm seeing them in my code for useful functions like remove-if.
>
> They've always been there.

Now I'm seeing them because I am actaully writing more elisp code rather
than little snippets.  I've just been noticing that the build is
complaining a lot more about various deprecated functions/macros like
flet (use cl-flet) more now so I thought all of the warnings were of a
newer character.

>
>> Could someone explain why these warnings are being generated?
>
> No point repeating ancient history. Search the archives, read the elisp
> manual "tips" section; or use cl-lib instead.

cl-lib is an external package, correct?

--
Burton Samograd



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

* Re: CL functions called at runtime
  2012-12-03 19:54 ` Stefan Monnier
@ 2012-12-03 20:03   ` Burton Samograd
  0 siblings, 0 replies; 12+ messages in thread
From: Burton Samograd @ 2012-12-03 20:03 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

>> I seemed to have missed the dicussion about the warnings being generated
>> by the byte compiler about CL functions being called at runtime.  Now
>> I'm seeing them in my code for useful functions like remove-if.
>> Could someone explain why these warnings are being generated?
>
> There are different such warnings for different cases, so please specify
> precisely what you see,

I'm seeing messages like "CL function 'remove-if' called at runtime."
Someone else suggested using cl-lib but I assume that's an external
package that I should install, correct?  

I have mostly been writing in Common Lisp prior to starting a new
project in Emacs Lisp only so I find certain CL functions useful and
wouldn't mind getting rid of the warnings when I compile the code.  If
downloading and install cl-lib and using the cl- prefix function will do
the trick then I'm ok with that.

--
Burton Samograd



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

* Re: CL functions called at runtime
  2012-12-03 19:59 ` Daniel Colascione
@ 2012-12-03 20:05   ` Burton Samograd
  2012-12-03 23:05     ` Grégoire Jadi
  2012-12-03 20:21   ` Glenn Morris
  1 sibling, 1 reply; 12+ messages in thread
From: Burton Samograd @ 2012-12-03 20:05 UTC (permalink / raw)
  To: Daniel Colascione; +Cc: emacs-devel

Daniel Colascione <dancol@dancol.org> writes:

> On 12/3/12 10:55 AM, Burton Samograd wrote:
>> Hi,
>> 
>> I seemed to have missed the dicussion about the warnings being generated
>> by the byte compiler about CL functions being called at runtime.  Now
>> I'm seeing them in my code for useful functions like remove-if.
>
> (defadvice byte-compile-warn (around shut-up-about-cl activate compile)
>   (let* ((fmt (ad-get-arg 0)))
>     (unless (string-match "cl package" fmt)
>       ad-do-it)))

Excellent, thank you.

--
Burton Samograd



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

* Re: CL functions called at runtime
  2012-12-03 19:59 ` Daniel Colascione
  2012-12-03 20:05   ` Burton Samograd
@ 2012-12-03 20:21   ` Glenn Morris
  1 sibling, 0 replies; 12+ messages in thread
From: Glenn Morris @ 2012-12-03 20:21 UTC (permalink / raw)
  To: Daniel Colascione; +Cc: Burton Samograd, emacs-devel

Daniel Colascione wrote:

> (defadvice byte-compile-warn (around shut-up-about-cl activate compile)
>   (let* ((fmt (ad-get-arg 0)))
>     (unless (string-match "cl package" fmt)
>       ad-do-it)))

(setq byte-compile-warnings '(not cl-functions))

Also works as a file-local.



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

* Re: CL functions called at runtime
  2012-12-03 20:00   ` Burton Samograd
@ 2012-12-03 20:22     ` Glenn Morris
  2012-12-03 21:53       ` Stefan Monnier
  0 siblings, 1 reply; 12+ messages in thread
From: Glenn Morris @ 2012-12-03 20:22 UTC (permalink / raw)
  To: Burton Samograd; +Cc: emacs-devel

Burton Samograd wrote:

> cl-lib is an external package, correct?

No. Included in 24.3+.



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

* Re: CL functions called at runtime
  2012-12-03 20:22     ` Glenn Morris
@ 2012-12-03 21:53       ` Stefan Monnier
  0 siblings, 0 replies; 12+ messages in thread
From: Stefan Monnier @ 2012-12-03 21:53 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Burton Samograd, emacs-devel

>> cl-lib is an external package, correct?
> No. Included in 24.3+.

It's also an external package available via ELPA for Emacs<24.3.


        Stefan



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

* Re: CL functions called at runtime
  2012-12-03 20:05   ` Burton Samograd
@ 2012-12-03 23:05     ` Grégoire Jadi
  0 siblings, 0 replies; 12+ messages in thread
From: Grégoire Jadi @ 2012-12-03 23:05 UTC (permalink / raw)
  To: emacs-devel

Burton Samograd <burton@samograd.ca> writes:

> Daniel Colascione <dancol@dancol.org> writes:
>
>> On 12/3/12 10:55 AM, Burton Samograd wrote:
>>> Hi,
>>> 
>>> I seemed to have missed the dicussion about the warnings being generated
>>> by the byte compiler about CL functions being called at runtime.  Now
>>> I'm seeing them in my code for useful functions like remove-if.
>>
>> (defadvice byte-compile-warn (around shut-up-about-cl activate compile)
>>   (let* ((fmt (ad-get-arg 0)))
>>     (unless (string-match "cl package" fmt)
>>       ad-do-it)))
>
> Excellent, thank you.

Or (byte-compile-disable-warning 'cl-functions)




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

end of thread, other threads:[~2012-12-03 23:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-03 18:55 CL functions called at runtime Burton Samograd
2012-12-03 19:54 ` Stefan Monnier
2012-12-03 20:03   ` Burton Samograd
2012-12-03 19:55 ` Glenn Morris
2012-12-03 20:00   ` Burton Samograd
2012-12-03 20:22     ` Glenn Morris
2012-12-03 21:53       ` Stefan Monnier
2012-12-03 19:56 ` Pascal J. Bourguignon
2012-12-03 19:59 ` Daniel Colascione
2012-12-03 20:05   ` Burton Samograd
2012-12-03 23:05     ` Grégoire Jadi
2012-12-03 20:21   ` Glenn Morris

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).