makelist(): argument size appears restricted to integer -- RFC
Subject: makelist(): argument size appears restricted to integer -- RFC
From: Robyn Dawn Hannigan
Date: Tue, 21 Apr 2009 23:06:38 +1200
Hello List,
In the last few days i have been experimenting with list programming. i
came across the following (IMO) defficiency in makelist.
>From the manual:
--------------------------------------------------------------------------
Constructs and returns a list, each element of which is generated from
expr.
makelist (expr, i, i_0, i_1) returns a list, the j'th element of which
is equal to ev (expr, i=j) for j equal to i_0 through i_1.
makelist (expr, x, list) returns a list, the j'th element of which is
equal to ev (expr, x=list[j]) for j equal to 1 through length (list).
-----------------------------------------------------------------------------
This is all well and good.
The following error was observed ion a wxMaxima session.
(%i1) s(n):= block([n:n],
apply("+",map(lambda([x],x^2),makelist(x,x,1,n))))$
(%i2) s(30!);
If 4 arguments are given to MAKELIST, the difference of the 3rd and 4th
arguments should evaluate to a non-negative integer:
265252859812191058636308479999999
#0: s(n=265252859812191058636308480000000)
-- an error. To debug this try debugmode(true);
What i assume this means is that the bug can be reduced to
makelist(x,x,1,265252859812191058636308479999999)
Which does indeed produce the same error message on my equipment:
wxMaxima 0.8.1 http://wxmaxima.sourceforge.net
Maxima 5.17.1 http://maxima.sourceforge.net
Using Lisp SBCL 1.0.27-r10-gentoo
Can anyone help me understand where it came from please?
Many Thanks,
Robyn