🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #99364

Nested defun.

#99364
From: markf
Date: Wed, 03 Oct 1990 16:51
20 lines
1288 bytes
In emacs version 18.55, the following code will work if it is directly
interpreted, but it will not work if it is byte compiled (I get an
error message of "Symbol's value as variable is void: new-defun"):

(defun test-defun()
  (if t
      (defun new-defun ()
        "grumble"
        (message "success"))))

I know that in lisps in general nested defuns are not allowed (and I
know the proper way to do this). If this is the intention in emacs
lisp then the interpreter should complain.  In addition, the
documentation on emacs and emacs lisp should mention the restriction
on the use of defun.

I discovered this problem in trying to use a package that someone else
wrote.

 -Mark
Technical Details
Message-ID: <9010031651.AA14155@life.ai.mit.edu>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!ALTDORF.AI.MIT.EDU!markf

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,124ca092283d6d57,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1990-10-03 16:34:30 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!ALTDORF.AI.MIT.EDU!markf
From: markf@ALTDORF.AI.MIT.EDU
Newsgroups: gnu.emacs.bug
Subject: Nested defun.
Message-ID: <9010031651.AA14155@life.ai.mit.edu>
Date: 3 Oct 90 16:51:44 GMT
Sender: daemon@tut.cis.ohio-state.edu
Reply-To: markf@zurich.ai.mit.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 20
Posted: Wed Oct  3 17:51:44 1990