[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.
Thanks!
Eric
- Re: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase [was: Add new bytecode op `switch' for implementing branch tables.], (continued)
- Re: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase [was: Add new bytecode op `switch' for implementing branch tables.], raman, 2017/02/23
- RE: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase [was: Add new bytecode op `switch' for implementing branch tables.], Drew Adams, 2017/02/23
- RE: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase [was: Add new bytecode op `switch' for implementing branch tables.], T.V Raman, 2017/02/23
- RE: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase [was: Add new bytecode op `switch' for implementing branch tables.], Drew Adams, 2017/02/23
- RE: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase [was: Add new bytecode op `switch' for implementing branch tables.], T.V Raman, 2017/02/23
- RE: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase [was: Add new bytecode op `switch' for implementing branch tables.], Drew Adams, 2017/02/23
- defsubst VS defun or defmacro [was RE: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase], Tino Calancha, 2017/02/23
- Re: defsubst VS defun or defmacro [was RE: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase], Eric Abrahamsen, 2017/02/23
- Re: defsubst VS defun or defmacro [was RE: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase], raman, 2017/02/23
- Re: defsubst VS defun or defmacro [was RE: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase],
Eric Abrahamsen <=
- Re: defsubst VS defun or defmacro [was RE: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase], raman, 2017/02/23
- Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables., Clément Pit-Claudel, 2017/02/09
- Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables., Clément Pit-Claudel, 2017/02/09
- Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables., Vibhav Pant, 2017/02/09
- Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables., Clément Pit-Claudel, 2017/02/09
- Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables., Vibhav Pant, 2017/02/10
- Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables., Stefan Monnier, 2017/02/10
- Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables., Vibhav Pant, 2017/02/10
- Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables., Stefan Monnier, 2017/02/10
- Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables., Vibhav Pant, 2017/02/10