for



Probably a bug, though there is this situation:

for i:a thru b step s do (s:-s)

is the termination test   i>s or i<s ?

I think this issue came up in the Algol 60 definition.  The Maxima user 
language is modeled on Algol 60, in case
you didn't know.


RJF

/


  /Adam Majewski wrote:
> Michel Talon pisze:
>   
>> Adam Majewski wrote:
>>
>>     
>>> for radius:4 thru 1 step -1 do disp(radius);
>>>       
>> (%i5) for radius:4 thru 1 step ''s do disp(radius);
>>                                        4
>>
>>                                        3
>>
>>                                        2
>>
>>                                        1
>>
>>
>>
>>     
> Thx for answer, it works.
> Why '' is needed only for step (increment), not for other values : 
> initial_value, limit ?
>
> --------------- first example (not works)-------------------
> (%i1) s:-1;
> rMax:4;
> rMin:1;
> for radius:rMax thru rMin step s do disp(radius);
> (%o1) -1
> (%o2) 4
> (%o3) 1
> (%o4) done
> ------------------second example (works) ----------------------
> (%i5) s:-1;
> rMax:4;
> rMin:1;
> for radius:rMax thru rMin step ''s do disp(radius);
> (%o5) -1
> (%o6) 4
> (%o7) 1
> 4
> 3
> 2
> 1
> (%o8) done
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>