help-gnu-emacs
[Top][All Lists]
Advanced

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

reference variable before definition


From: Eric Abrahamsen
Subject: reference variable before definition
Date: Sat, 11 Mar 2017 18:03:05 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

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





reply via email to

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