Subject: scope of declarations, was Re: bug in trigsimp?
From: R Fateman
Date: Wed, 11 Mar 2009 12:39:21 -0400
Here's a list, off the top of my head, of things that can be attached to
a symbol in Maxima.
probably incomplete.
matchdeclare(F, predicate)
tellsimp(F(..), .. )
values F: ...
function definition: F(..):=
properties: put(F,value, indicator)
assume(F>0)
declare(F, real)
...
Perhaps we can agree that all this data pertains only to the "top level"
F in Maxima, and that the F
in this construction...
foo(x,y,F,z):= has nothing to do with the top-level F?
we then may wonder about
foo(x):= block([F], put(F,...) , matchdeclare(F, ..) ...
should that change the global F or the local F?
or do we require
foo(x):=block([F],local(F), ....)
This also may interact with context() which has the effect of binding
assumptions, but not other properties.
If we don't make such a determination about locality of properties, it
is essentially impossible to write programs that avoid RM's bug.
Robert Marik wrote:
> Hello, is this a bug in trigsimp?
>
> Robert Marik
>
> Maxima 5.17.1 http://maxima.sourceforge.net
> Using Lisp CLISP 2.44.1 (2008-02-23)
> Distributed under the GNU Public License. See the file COPYING.
> Dedicated to the memory of William Schelter.
> The function bug_report() provides bug reporting information.
> (%i1) declare(x,constant);
> (%o1) done
> (%i2) trigsimp(y);
> Improper parameter in function definition for trigsimp:
> x
> #0: trigsimp(?_l=[y])(trgsmp.mac line 70)
> -- an error. To debug this try debugmode(true);
> (%i3)
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>