all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* byte-opt.el vs declare
@ 2022-07-26 19:57 Sam Steingold
  2022-07-27  8:31 ` Mattias Engdegård
  0 siblings, 1 reply; 2+ messages in thread
From: Sam Steingold @ 2022-07-26 19:57 UTC (permalink / raw)
  To: emacs-devel

I thought that byte-opt was intended to set `pure'. `side-effect-free'
&c properties for functions that are defined in C and functions defined
in Lisp should get these from `declare'.

However, I see that, e.g., `xor' uses `declare' but `string-prefix-p' is
listed in byte-opt and does not have a declaration.

What is the official policy?

Thank you.

-- 
Sam Steingold (http://sds.podval.org/) on darwin Ns 10.3.2113
http://childpsy.net http://calmchildstories.com http://steingoldpsychology.com
https://iris.org.il https://www.memritv.org https://ffii.org
Failure is not an option. It comes bundled with your Microsoft product.



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

* Re: byte-opt.el vs declare
  2022-07-26 19:57 byte-opt.el vs declare Sam Steingold
@ 2022-07-27  8:31 ` Mattias Engdegård
  0 siblings, 0 replies; 2+ messages in thread
From: Mattias Engdegård @ 2022-07-27  8:31 UTC (permalink / raw)
  To: sds; +Cc: emacs-devel

26 juli 2022 kl. 21.57 skrev Sam Steingold <sds@gnu.org>:

> I thought that byte-opt was intended to set `pure'. `side-effect-free'
> &c properties for functions that are defined in C and functions defined
> in Lisp should get these from `declare'.

Not official by any means, but I'd suggest `declare` be used for new Lisp functions and set the properties for C functions in byte-opt for now.

There is a considerable legacy, mind, and it's probably not worth changing all of it right away. If there turns out to be a more substantial benefit from doing so then someone working on the byte-compiler will deal with it.




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

end of thread, other threads:[~2022-07-27  8:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-26 19:57 byte-opt.el vs declare Sam Steingold
2022-07-27  8:31 ` Mattias Engdegård

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.