The user documentation for mode_declare says:
The arguments of mode_declare are pairs consisting of a variable and a
mode which is one of boolean, fixnum, number, rational, or float.
Since 'constant' isn't listed in the possible modes, maybe the warning
issued by define_variable(x,0,constant) should be more stern.
Barton
-----maxima-bounces at math.utexas.edu wrote: -----
>On?Wed,?22?Jul?2009,?Richard?Fateman?wrote:
>
><?Leo?Butler?wrote:
><?>?Is?this?a?bug??That?is,?is?the?declaration?that?x?is?a?constant
>expected
><?>?to?preclude?assigment?
>?>
><?I?think?this?is?not?a?bug,??0?is?a?constant,?and?1?is?a?constant.
><
>
>So?the?declaration?'constant'?is?not?analogous?to?C's?'const'??It?simply
>is?expected?that?one?can?only?assign?constants?to?constants??If?so,?then
>what?about?this:
>
>(%i2)?define_variable(x,0,constant);
>modedeclare:?warning:?constant?is?not?a?built-in?type;?assuming?it?is?a
>Maxima?extension?type.
>(%o2)?0
>(%i3)?constantp(x);
>(%o3)?true
>(%i4)?constantp(y);
>(%o4)?false
>(%i5)?x:y;
>(%o5)?y
>
>Leo
>
>--
>The?University?of?Edinburgh?is?a?charitable?body,?registered?in
>Scotland,?with?registration?number?SC005336.
>
>_______________________________________________
>Maxima?mailing?list
>Maxima at math.utexas.edu
>http://www.math.utexas.edu/mailman/listinfo/maxima