[Maxima] [Fwd: array functions]

Dan Stanger dan.stanger@ieee.org
Sat, 22 Mar 2003 08:57:06 -0700


This is a multi-part message in MIME format.
--------------F3D575C12D306EC06E5EB98B
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

This was posted to sci.math.symbolic in response to the same question.
Is this what funmake is used for?
Dan Stanger

--------------F3D575C12D306EC06E5EB98B
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Reply-To: "Marie Donnelly-Harten" <mariedonnellyhar@earthlink.net>
From: "Marie Donnelly-Harten" <mariedonnellyhar@earthlink.net>
Newsgroups: sci.math.symbolic
References: <3E7B2219.47FD5A09@ieee.org>
Subject: Re: array functions
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Message-ID: <1PGea.12904$pK4.1097799@newsread1.prod.itd.earthlink.net>
Date: Fri, 21 Mar 2003 16:09:33 GMT
NNTP-Posting-Host: 63.214.67.65
X-Complaints-To: abuse@earthlink.net
X-Trace: newsread1.prod.itd.earthlink.net 1048262973 63.214.67.65 (Fri, 21 Mar 2003 08:09:33 PST)
NNTP-Posting-Date: Fri, 21 Mar 2003 08:09:33 PST
Organization: EarthLink Inc. -- http://www.EarthLink.net
Path: omega.dimensional.com!dimensional.com!pulsar.dimensional.com!newsfeed.frii.net!newsfeed.frii.net!news-out.newsfeeds.com!propagator2-maxim!news-in.spamkiller.net!newsfeed.sjc.globix.net!cyclone-sf.pbi.net!151.164.30.35!cyclone.swbell.net!newsfeed1.easynews.com!easynews.com!easynews!newsfeed1.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!not-for-mail
Xref: omega.dimensional.com sci.math.symbolic:24381

The problem with h1[1]([1,2]) is that
h1[1] is simply lambda([x],x) in
the latest sourceforge version.
The problem appears to persist in such further
attempts as
h2[k]:=lambda([x],print("x=",x),x);
but if you do
h3[k]:=lambda([x],funmake(print,["x=",x]),x);
then h3[2]([4,5]); prints a line
x= [4,5]
and returns value [4,5].
I suspect that the issue is the amount of evaluation that
is performed when the array element h1[2] is calculated
before the application to the argument(s). This appears
to differ from my recollection of the original DOE-Macsyma requirements.

Leo Harten
marie@priority1.net (use my wife's PC for this NG)

"Dan Stanger" <dan.stanger@ieee.org> wrote in message
news:3E7B2219.47FD5A09@ieee.org...
> If I declare the array function h1[k](x):=block(print(x));
> and execute h1[1]([1,2]);
> it prints x, not [1,2] but the function returns [1,2].
> Shouldnt it print [1,2], not x?
> I see this behavior in maxima 5.5, and Macsyma 2.4.
> Can anyone think of a work around for this or explain this behavior?
> Dan Stanger
>
>



--------------F3D575C12D306EC06E5EB98B--