Inconsistency when using previously defined variables as arguments to functions
Subject: Inconsistency when using previously defined variables as arguments to functions
From: thomas
Date: Wed, 26 Jan 2011 12:06:40 +0100
Hi there!
Some commands, such as "limit" or "sum" take a "target"-variable as an
argument. E.g. for limit or sum, this is the 2nd argument. However,
there is an inconsistency in the way maxima behaves when this variable
was previously defined:
$ maxima
Maxima 5.23.2 http://maxima.sourceforge.net
using Lisp SBCL 1.0.40.0.debian
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) i:1;
(%o1) 1
(%i2) limit(1/i, i, infinity);
limit: second argument must be a variable, not a constant; found: 1
-- an error. To debug this try: debugmode(true);
(%i3) sum(1/i, i, 1, 2);
3
(%o3) -
2
Since the 2nd argument in these commands is basically "local" to the
command, it is my understanding that "sum" behaves correctly in this
case, while "limit" (and others like "diff") should somehow be fixed. At
least that is my understanding. Would this be possible/feasible?
If that's not the case: is there some way to work around this? I've
tried using local and a block, but that didn't seem to work out :( Any
advice?
Cheers
Thomas