From: SourceForge.net <no...@so...> - 2009-01-03 12:32:21
|
Bugs item #546077, was opened at 2002-04-19 13:35 Message generated for change (Comment added) made by crategus You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=546077&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Lisp Core Group: Includes proposed fix >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Pedro Fortuny Ayuso (pfortuny) Assigned to: Nobody/Anonymous (nobody) Summary: array: not dynamical sizes/FIX Initial Comment: The following code does not work: ---------------------------text.mac------------------- use_fast_arrays : true; trial(a):= block([myvar, i], /*local (i)*/ /* Comment this or not, it's the same */ array(i,a), for myvar : 1 thru 7 do i[myvar] : [], i[1])$ ---------------------------text.mac end--------------- It might be an (undocumented) issue, in which case the bug is in the doc, or it might be a real bug (I think one should be able to dimension arrays using variables, not only numbers). ====================follows session=================== Session: bash-2.05$ maxima GCL (GNU Common Lisp) Version(2.4.0) Sat Jul 14 20:26:43 GMT 2001 Licensed under GNU Library General Public License Contains Enhancements by W. Schelter Maxima 5.6 Sat Jul 14 20:26:37 GMT 2001 (with enhancements by W. Schelter). Licensed under the GNU Public License (see file COPYING) (C1) load("text.mac"); (D1) text.mac (C2) trial(30); Error: |$a| is not of type NUMBER. Fast links are on: do (si::use-fast-links nil) for debugging Error signalled by MACSYMA-TOP-LEVEL. Broken at MACSYMA-TOP-LEVEL. Type :H for Help. MAXIMA>>:q (C3) ===============end of session=================== ---------------------------------------------------------------------- >Comment By: Dieter Kaiser (crategus) Date: 2009-01-03 13:32 Message: The suggested fix is applied in revision 1.72. Closing the bug report. ---------------------------------------------------------------------- Comment By: Robert Dodier (robert_dodier) Date: 2009-01-03 10:03 Message: > I think we should do the proposed fix and close the bug report. OK by me. Thanks for following up. ---------------------------------------------------------------------- Comment By: Dieter Kaiser (crategus) Date: 2009-01-03 02:44 Message: I have tested the proposed fix. With this fix fast arrays and normal arrays work identically. The code for normal arrays already contains the following line (setq diml (mapcar #'meval diml)) which does an evaluation of the dimension list. An example is: (%i) i:3$ (%i4) array(a,2*i+1); /* normal array */ (%o4) a (%i8) use_fast_arrays:true$ (%i9) array(b,2*i+1); /* works now for fast array too */ (%o9) ?\#\(NIL\ NIL\ NIL\ NIL\ NIL\ NIL\ NIL\ NIL\) (%i10) array(wer,3+3); /* the original example */ (%o10) ?\#\(NIL\ NIL\ NIL\ NIL\ NIL\ NIL\ NIL\) The testsuite has no problems. I think we should do the proposed fix and close the bug report. Dieter Kaiser ---------------------------------------------------------------------- Comment By: Stavros Macrakis (macrakis) Date: 2004-02-24 02:06 Message: Logged In: YES user_id=588346 The blocks, loops, etc. are irrelevant; any non-constant argument causes this problem: use_fast_arrays: true$ array(wer,3+3) => Error: ((MPLUS) 3 3) is not of type NUMBER. Fix in $ARRAY: ($use_fast_arrays (mset (car x) (apply '$make_array '$any (mapcar #'(lambda (dim) ;;let make_array catch bad vals (add 1 (meval dim))) (cdr x))))) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=546077&group_id=4933 |