Question regarding loops and CAR: #:G18223 is not a list
Subject: Question regarding loops and CAR: #:G18223 is not a list
From: Robert Dodier
Date: Thu, 19 Jan 2006 09:28:40 -0700
On 1/18/06, Jarrett Byrnes <jebyrnes at ucdavis.edu> wrote:
> /*loop through each value of dmax */
> for dmax in [1,0.5,0.01] do
> /*loop through each value of b we're using*/
> ( for b: 0 thru 1 step .5 do
instead of nested loops, a somewhat more maxima-ish way to do this is
to use outermap --
outermap (foo, [1, 2, 3], [a, b]); => [[foo(1, a), foo(1, b)],
[foo(2, a), foo(2, b)], [foo(3, a), foo(3, b)]]
if you're coming from scheme, maxima has functions apply, map, lambda,
and a few others that might seem familiar.
hth
robert dodier