"Drew Adams" <[EMAIL PROTECTED]> writes:

> Trying this again, as I received no response. Thanks, Drew.
>
>     Sent: Sunday, May 15, 2005 3:48 PM
>
>     Is the code defining a nested defun byte-compiled when its enclosing
>     defun is compiled? Example source file foo.el:
>
>     (defcustom define-bar-flag t "Define `bar' if non-nil.")
>     (defun foo ()
>       "Do foo stuff. Define `bar' if `define-bar-flag' is non-nil."
>       (when define-bar-flag (defun bar () (bar-stuff)))
>       (rest-of-foo-stuff))
>
>     Suppose foo.el is byte-compiled, and then foo.elc

[random speculations snipped]

If you open foo.elc with Emacs, you can see that the compiled definition
for `foo' contains a compiled definition for `bar'.

If you still have a doubt, you can:
M-x load-file
foo.elc
ESC ESC :
(foo)
;; this defines `bar' and signals an error because `rest-of-foo-stuff'
;; is not defined...
M-x debug-on-entry
bar
ESC ESC :
(bar)
d
;; and you see:
Debugger entered--beginning evaluation of function call form:
* (byte-code "À �" [bar-stuff] 1)
* bar()
  eval((bar))
  eval-expression((bar) nil)
  call-interactively(eval-expression)


HTH,

Thierry
-- 
thierry |point| emery |chez| free |point| fr
_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

Reply via email to