From: Eli Bendersky
Subject: "neither declared nor bound" warning
Date: 
Message-ID: <yqcsmxoh4xz.fsf@lnx-baruch.haifa.ibm.com>
        Hi all,

My question concerns compiling lisp files with
compile-file (using GNU CLISP 2.28).

In one file, some global variables are defined, an
other file uses them. When I compile-file this other
file, I get a bunch of:

WARNING in function BFS1 in lines 38..52 :
*BRANCHES* is neither declared nor bound,

Warnings. How should I go about it to avoid the warnings ? 
This leads to a more general question. If I want to have
global variables declared in some file and then used and
assigned to with setf, how should I declare those variables ? 
With defvar ?

These variables serve as counters to print search
statistics, so making them global sounds reasonable.

Thanks in advance

Eli

-- 
Email: ________ at yahoo dot com
(the username is spur4444)

Website: http://www.geocities.com/spur4444/ 

From: Nils Goesche
Subject: Re: "neither declared nor bound" warning
Date: 
Message-ID: <lkof8cqy7n.fsf@cartan.de>
Eli Bendersky <··@the.signature> writes:

> My question concerns compiling lisp files with compile-file (using
> GNU CLISP 2.28).
> 
> In one file, some global variables are defined, an other file uses
> them. When I compile-file this other file, I get a bunch of:
> 
> WARNING in function BFS1 in lines 38..52 :
> *BRANCHES* is neither declared nor bound,
> 
> Warnings. How should I go about it to avoid the warnings ?

Load the file containing the DEFVARs or DEFPARAMETERs before compiling
the other file.

> This leads to a more general question. If I want to have global
> variables declared in some file and then used and assigned to with
> setf, how should I declare those variables ?  With defvar ?

DEFVAR or DEFPARAMETER.  Use DEFPARAMETER if you want them to be
initialized again each time you load the file containing these forms,
use DEFVAR if you want them to keep their values.  This can ease
debugging, for instance, if they contain complex data structures, or
streams which you don't want to be lost each time you recompile and
load the file.

Regards,
-- 
Nils G�sche
"Don't ask for whom the <CTRL-G> tolls."

PGP key ID 0x0655CFA0
From: Eli Bendersky
Subject: Re: "neither declared nor bound" warning
Date: 
Message-ID: <yqcof8cgtz2.fsf@lnx-baruch.haifa.ibm.com>
Nils Goesche <······@cartan.de> writes:
<snip>
> DEFVAR or DEFPARAMETER.  Use DEFPARAMETER if you want them to be
> initialized again each time you load the file containing these forms,
> use DEFVAR if you want them to keep their values.  This can ease
> debugging, for instance, if they contain complex data structures, or
> streams which you don't want to be lost each time you recompile and
> load the file.

Thanks, Nils, this works. 

-- 
Email: ________ at yahoo dot com
(the username is spur4444)

Website: http://www.geocities.com/spur4444/