On 7/7/10 12:31 PM, Zbigniew Komarnicki wrote:
> Hello,
>
> I try to write fuction that return a list of number in range [a,b] with step
> k, but first i try in command window this code:
>
> /* This work in command window without variables */
> kill(all);
> m:[];
> for i:0 step -3 thru 10 do (m:append(m, [i]), display(i));
> display(m);
>
What were you expecting? I get m being an empty list.
> Here is OK, but this below is not OK:
>
> /* This does NOT work in command window with variables */
> kill(all);
> a:0;
> b:10;
> k:-3;
> m:[];
> for i:a step k thru b do (m:append(m, [i]), display(i));
> display(m);
>
>
>
[snip]
>
> I work in Linux, Debian Lenny i386 with this version of Maxima:
>
> Maxima 5.13.0 http://maxima.sourceforge.net
>
That's pretty ancient, even by maxima standards. :-)
FWIW, I don't have this problem with your second example. I get m being
the empty list.
Ray