unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* reference variable before definition
@ 2017-03-12  2:03 Eric Abrahamsen
  2017-03-12  2:06 ` Eric Abrahamsen
  2017-03-12  3:18 ` Stefan Monnier
  0 siblings, 2 replies; 6+ messages in thread
From: Eric Abrahamsen @ 2017-03-12  2:03 UTC (permalink / raw)
  To: help-gnu-emacs

I can't tell if it's always been this way: I'm getting compiler warnings
about "reference to free variable" if the variable appears in a function
definition before it's defined in the file. So compiling this produces
warnings:

(defun make-my-day ()
  (message "It's: %s" my-day))

(defvar my-day "Monday")

Has it always been this way, and it only just got through to me? I
didn't think it was necessary to define everything before use in a
function...

Hoping I'm just hallucinating something,
Eric





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-03-12  7:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-12  2:03 reference variable before definition Eric Abrahamsen
2017-03-12  2:06 ` Eric Abrahamsen
2017-03-12  3:18 ` Stefan Monnier
2017-03-12  3:40   ` Eric Abrahamsen
2017-03-12  3:55     ` Stefan Monnier
2017-03-12  7:26       ` Eric Abrahamsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).