[Top][All Lists]

[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: Eric Abrahamsen
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 20:20:21 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

raman <address@hidden> writes:

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

Good, these were the principles I was working from, though in my case I
had no empirical data to support them :)

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

Okay, makes sense. I've never been tempted to use defsubsts for anything
more than two-liners, but I'll keep an eye on this.


reply via email to

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