[Top][All Lists]

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

Re: nested defsubst?

From: Barry Margolin
Subject: Re: nested defsubst?
Date: Mon, 10 Aug 2015 02:15:50 -0500
User-agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X)

In article <address@hidden>,
 Ian Zimmerman <address@hidden> wrote:

> Is it useful?  That is, if I do this:
> (defsubst foo ()
>   "foo")
> (defsubst foobar ()
>   (concat (foo) "bar"))
> will foobar contain an inlined copy of foo, _and_ will subsequent calls
> to foobar be inlined?

Yes to both.

To determine this, compile them and then use M-x disassemble to see 
whether it's inlined.

(defun use-foobar () (foobar))

M-x compile-defun

M-x disassemble use-foobar

byte code for use-foobar:
  args: nil
0       constant  "foo"
1       constant  "bar"
2       concat2   
3       return

Barry Margolin, address@hidden
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***

reply via email to

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