emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: defsubst VS defun or defmacro [was RE: Compiled code in Emacs-26 wil


From: raman
Subject: Re: defsubst VS defun or defmacro [was RE: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase]
Date: Thu, 23 Feb 2017 19:56:19 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

The rule of thumb I've used over the years:

1. Never use defmacro except when creating a special-form or special
notation AKA DSL 

2. Use defun except for short and often repeated forms that also need
speed, then I've used defsubst because they behave like functions for
all practical purposes such as mapcar.

3. I had done some timing in the early days of emacspeak, including
looking at what M-x disassemble produced, then tighten the inner loop of
emacspeak appropriately with defsubst.

4. What just broke is  calls to defsubst-defined functions from within
other defsubst --- independent of our various views on the misguidedness
or otherwise of defsubst, I believe this is a bug that might be worth
fixing since it breaks  working code in mysterious and unpredictable ways.
-- 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]