From: Joost Kremers <joostkremers@fastmail.fm>
To: Eric Abrahamsen <eric@ericabrahamsen.net>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Did `inline' used to do something else?
Date: Sun, 19 Nov 2017 10:53:55 +0100 [thread overview]
Message-ID: <87r2suoaq4.fsf@fastmail.fm> (raw)
In-Reply-To: <878tf3z3ub.fsf@ericabrahamsen.net>
On Sat, Nov 18 2017, Eric Abrahamsen wrote:
> The function `inline' is an alias for `progn'.
>
> Gnus is full of code where inline is called with a single
> argument, ie a
> no-op, which makes me think `inline' used to do something else?
> I've
> tried searching git logs, with no results -- did this function
> used to
> actually inline code?
I looked at the source to see where it is defined and found the
following in `byte-run.el':
;; Redefined in byte-optimize.el.
;; This is not documented--it's not clear that we should
promote it.
(fset 'inline 'progn)
At first, I couldn't find the referenced file `byte-optimize.el',
so I went back in time, but this `fset' call plus comment was
already present in what seems to be the first version of
`byte-run.el' from 25 years ago. Then I noticed that there is a
file called `byte-opt.el' and indeed, this is the file being
referred to. It contains the following:
;;; byte-compile optimizers to support inlining
(put 'inline 'byte-optimizer 'byte-optimize-inline-handler)
Followed by a definition of `byte-optimize-inline-handler'.
There's no mention of the symbol property `byte-optimizer', and I
know next to nothing about byte compilation, but its name is
suggestive, of course. (In fact, all `defsubst' does is to define
a function and to put this property in the function symbol's plist
with the value `byte-compile-inline-expand'.)
So, long story short, even though `inline' is presented as an
alias for `progn', it's handled differently by the byte compiler,
presumably to deal with performance bottlenecks.
--
Joost Kremers
Life has its moments
next prev parent reply other threads:[~2017-11-19 9:53 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-18 21:14 Did `inline' used to do something else? Eric Abrahamsen
2017-11-19 0:05 ` Emanuel Berg
2017-11-19 0:38 ` Eric Abrahamsen
2017-11-19 2:01 ` Emanuel Berg
2017-11-19 5:59 ` Eric Abrahamsen
2017-11-19 9:53 ` Joost Kremers [this message]
2017-11-19 10:00 ` Joost Kremers
2017-11-19 15:01 ` Emanuel Berg
2017-11-19 16:02 ` Michael Heerdegen
2017-11-19 17:17 ` Emanuel Berg
2017-11-19 20:48 ` Eric Abrahamsen
2017-11-19 21:16 ` Emanuel Berg
2017-11-19 22:06 ` Eric Abrahamsen
2017-11-19 22:51 ` Emanuel Berg
2017-11-20 3:56 ` Emanuel Berg
2017-11-20 4:04 ` Emanuel Berg
2017-11-20 19:31 ` Michael Heerdegen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r2suoaq4.fsf@fastmail.fm \
--to=joostkremers@fastmail.fm \
--cc=eric@ericabrahamsen.net \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.