John Lapeyre | 6 Sep 04:50

compiling and undefined variables

Here I compile two functions
(the source is given below)

(%i2) compile(integerdigits,fromdigits);

Warning-> block is an undefined global variable.
Warning-> m is an undefined global variable.
Warning-> diff is an undefined global variable.
Warning-> b is an undefined global variable.
Warning-> r is an undefined global variable.
Warning-> pad is an undefined global variable.
Warning-> i is an undefined global variable.
Warning-> s is an undefined global variable.

I wonder why these warnings appear ?
The functions still seem to work, but I haven't
tested them thoroughly.

------code

/*
   integerdigit(n) returns list of digits in integer n
   integerdigits(n,b) returned digits are in base b
   integerdigits(n,b,pad) leading zeros appended so list
            is of total length pad.
   for base greater than 10, additional digits are denoted in decimal,
   not using A,B, etc.
*/
integerdigits(n,[ib]) := (block[m,r:[],b:10,pad:0,diff],
   n : abs(n),
(Continue reading)

Raymond Toy | 6 Sep 06:41

Re: compiling and undefined variables

John Lapeyre wrote:
> Here I compile two functions
> (the source is given below)
>
> (%i2) compile(integerdigits,fromdigits);
>
> Warning-> block is an undefined global variable.
> Warning-> m is an undefined global variable.
> Warning-> diff is an undefined global variable.
> Warning-> b is an undefined global variable.
> Warning-> r is an undefined global variable.
> Warning-> pad is an undefined global variable.
> Warning-> i is an undefined global variable.
> Warning-> s is an undefined global variable.
>
> I wonder why these warnings appear ?
> The functions still seem to work, but I haven't
> tested them thoroughly.
>
> ------code
>
>
> integerdigits(n,[ib]) := (block[m,r:[],b:10,pad:0,diff],
>   
I think you meant to write block([m,r:[],...], instead of (block[...]

Ray
Richard Hennessy | 6 Sep 07:12
Favicon

Re: compiling and undefined variables

That's not it.  I checked it, there are 2 unnecessary parentheses around the block.

Rich

 ------------Original Message------------
From: Raymond Toy <toy.raymond <at> gmail.com>
To: pdl <at> johnlapeyre.com
Cc: "maxima list" <maxima <at> math.utexas.edu>
Date: Sat, Sep-6-2008 0:41 AM
Subject: Re: [Maxima] compiling and undefined variables

John Lapeyre wrote:
> Here I compile two functions
> (the source is given below)
>
> (%i2) compile(integerdigits,fromdigits);
>
> Warning-> block is an undefined global variable.
> Warning-> m is an undefined global variable.
> Warning-> diff is an undefined global variable.
> Warning-> b is an undefined global variable.
> Warning-> r is an undefined global variable.
> Warning-> pad is an undefined global variable.
> Warning-> i is an undefined global variable.
> Warning-> s is an undefined global variable.
>
> I wonder why these warnings appear ?
> The functions still seem to work, but I haven't
> tested them thoroughly.
>
(Continue reading)

John Lapeyre | 6 Sep 07:38

Re: compiling and undefined variables

Thanks for the help. I just tried to check if what you wrote
was correct, but instead I clobbered the file containing 20
mathematica compatibility functions that I've been writing
over the past few days. Maxima has similar looking compile
commands with some taking input filenames and some output;
I screwed it up. I quit for the night!
Richard Hennessy | 6 Sep 10:41
Favicon

Re: compiling and undefined variables

Sorry about that.  Keep the parentheses, they are okay.  I was wrong.

 ------------Original Message------------
From: John Lapeyre <pdl <at> johnlapeyre.com>
To: "Richard Hennessy" <rvh2007 <at> comcast.net>
Cc: "Raymond Toy" <toy.raymond <at> gmail.com>, "maxima list" <maxima <at> math.utexas.edu>
Date: Sat, Sep-6-2008 1:38 AM
Subject: Re: [Maxima] compiling and undefined variables

Thanks for the help. I just tried to check if what you wrote
was correct, but instead I clobbered the file containing 20
mathematica compatibility functions that I've been writing
over the past few days. Maxima has similar looking compile
commands with some taking input filenames and some output;
I screwed it up. I quit for the night!

Gmane