Re: pi seems not to be a constant
[email protected] (Don Cohen)
| Newsgroups | gmane.lisp.clisp.general |
|---|---|
| Message-ID | <[email protected]> |
Pierpaolo Bernardi writes: > A typical use case for adjustable precision floats is the following: > > (setf (ext:long-float-digits) some-appropriate-number-of-bits) > (large-body-of-standard-portable-cl-code-using-long-floats) > > If long-float-digits is changed and the "constants" are not adjusted > then STANDARD PORTABLE CL code will break. I don't understand what you think will go wrong. Please specify. > And if you use it then everything breaks. So removing it will > avoid troubles. I don't accept that everything breaks if you use it. However if you remove it and still use it then clearly it does break. Given that nothing goes wrong if you DON'T use it, and you're guaranteeing to break code that DOES use it, removing it can only make things worse. > Maybe a simpler solution could be to replace CL:CONSTANTP with > something similar to > > (setf (symbol-function 'cl::system-constantp) (symbol-function 'cl:constantp) > > (defun cl:constantp (x) > (case s > ((CL:PI CL:MOST-POSITIVE-LONG-FLOAT ...) t) > (otherwise (cl::system-constantp x)))) > > when compliance wrt this issue is desired. > > Would this break something? In other words would it break something to change things that are declared (or at least recognized as) constants (presumably the compiler and the rest of the system use cl:constantp and not system-constantp)? I would certinly expect so. Unless constantp is not used at all. ------------------------------------------------------------------------------ _______________________________________________ clisp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/clisp-list