From: Mark Volkmann <r.volkmann@gm...>  20110123 02:29:43

I'm having trouble finding a list of the predefined constants in Common Lisp such as pi. Anyone know where I can find such a list? Also, why does (incf pi) change pi to 4.1415926535897932383L0 if pi is a constant?  R. Mark Volkmann Object Computing, Inc. 
From: Pascal J. Bourguignon <pjb@in...>  20110123 07:12:18

Mark Volkmann <r.mark.volkmann@...> writes: > I'm having trouble finding a list of the predefined constants in > Common Lisp such as pi. Anyone know where I can find such a list? You can get the list of constant VARIABLES in the CL package with: (doexternalsymbols (s "CL") (when (constantp s) (print s))) > Also, why does (incf pi) change pi to 4.1415926535897932383L0 if pi is > a constant? Because you should NOT try to modify a constant VARIABLE. Notice that in CL, there are only variables, some of them may be declared constant, that is, you may promise to the compiler that you won't be modifying them. So the compiler may use optimization tricks with those variables, such as duplicating their values inline etc. And remember: constant aren't, variables won't.  __Pascal Bourguignon__ http://www.informatimago.com/ A bad day in () is better than a good day in {}. 
From: Dan Becker <db19606@gm...>  20110123 18:37:10

On Sun, Jan 23, 2011 at 12:03 AM, Pascal J. Bourguignon <pjb@...> wrote: > > You can get the list of constant VARIABLES in the CL package with: > > (doexternalsymbols (s "CL") (when (constantp s) (print s))) > Interesting ... but clisp doesn't print PI when you evaluate this (at least for 2.48). sbcl does print it. >> Also, why does (incf pi) change pi to 4.1415926535897932383L0 if pi is >> a constant? > FWIW, if you try to incf something that clisp does print when evaluating your form, it does complain. So I think something a bit odd is going on in clisp here. Dan 
From: Vladimir Tzankov <vtzankov@gm...>  20110123 22:28:11

On 1/23/11, Dan Becker <db19606@...> wrote: > Interesting ... but clisp doesn't print PI when you evaluate this (at > least for 2.48). Since it is not constant variable! >>> Also, why does (incf pi) change pi to 4.1415926535897932383L0 if pi is >>> a constant? See: http://clisp.org/impnotes/numconcepts.html#numconst (Float limits section) Vladimir 
From: Mark Volkmann <r.volkmann@gm...>  20110124 00:56:52

On Sun, Jan 23, 2011 at 4:28 PM, Vladimir Tzankov <vtzankov@...> wrote: > On 1/23/11, Dan Becker <db19606@...> wrote: >> Interesting ... but clisp doesn't print PI when you evaluate this (at >> least for 2.48). > Since it is not constant variable! > >>>> Also, why does (incf pi) change pi to 4.1415926535897932383L0 if pi is >>>> a constant? > See: http://clisp.org/impnotes/numconcepts.html#numconst (Float > limits section) Interesting. Thanks for explaining that! pi > 3.1415926535897932385L0 (setf (ext:longfloatdigits) 128) pi > 3.1415926535897932384626433832795028842L0  R. Mark Volkmann Object Computing, Inc. 