Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#344 translate doesn\'t check return types

open
nobody
5
2006-04-10
2003-07-08
Stavros Macrakis
No

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.

Discussion

  • Robert Dodier
    Robert Dodier
    2006-04-10

    • labels: --> Lisp Core - Translator
    • summary: translate doesn't check return types --> translate doesn\'t check return types