How to prevent evaluation.



Thanks but I think I need to use funmake("if", L) since then I can control the contents of the list L dynamically.  I 
can't see a way to do that with buildq().

Rich

--------------------------------------------------
From: "Robert Dodier" <robert.dodier at gmail.com>
Sent: Tuesday, January 05, 2010 5:01 PM
To: "Richard Hennessy" <rich.hennessy at verizon.net>
Cc: "Maxima List" <maxima at math.utexas.edu>
Subject: Re: [Maxima] How to prevent evaluation.

> On Mon, Dec 28, 2009 at 2:33 PM, Richard Hennessy
> <rich.hennessy at verizon.net> wrote:
>
>> What I think I need to do is dynamically generate an
>> if then else statement as the output from piecewise().
>
> My advice is to do that via buildq which is essentially
> a mechanism to substitute in parallel without evaluation.
>
> buildq ([e : x > 0, a1 : foo + 1, a2 : foo - 1], if e then a1 else a2);
> => if x > 0 then foo + 1 else foo - 1
>
> HTH
>
> Robert Dodier
>