rtoy / maxima

A Clone of Maxima's repo
Other
0 stars 0 forks source link

translate doesn\'t check return types #1744

Open rtoy opened 3 months ago

rtoy commented 3 months ago

Imported from SourceForge on 2024-07-05 06:46:44 Created by macrakis on 2003-07-08 01:11:55 Original: https://sourceforge.net/p/maxima/bugs/344


five():=block([], modedeclare(function(f),float), 5);

translate(f) gives no error message

translate clearly has the information necessary to detect this error, since it puts the property function- mode:$fixnum onto $five.

Compare for that matter:

(C54) fivea():=block([r],modedeclare(r,float),r:5,r)$ (C55) translate(fivea)$ (C56) fivea(); (D56) 5.0

(C57) fiveb():=block([],modedeclare(function (fiveb),float),5)$ (C58) translate(fiveb)$ (C59) fiveb(); (D59) 5

Note that declaring a *variable* as float forces operations to be float, whereas declaring a function value to be float does not.

rtoy commented 3 months ago

Imported from SourceForge on 2024-07-05 06:46:45 Created by robert_dodier on 2006-04-10 18:45:35 Original: https://sourceforge.net/p/maxima/bugs/344/#0fb7