programming, using op(), was ..RE: Bugfix for GosperSum? (was: cannot load Zeilberger)
Subject: programming, using op(), was ..RE: Bugfix for GosperSum? (was: cannot load Zeilberger)
From: Richard Fateman
Date: Sun, 7 Jan 2007 11:56:54 -0800
Attached is an implementation (in lisp) of a case statement.
I disagree with your design that looks like case(a,b,c,d,e,f,g). Too easy to
lose the parity.
I prefer case(a,[b,c],[d,e]...). Note that [] is used to enclose lists, and
is used in some options for Taylor series, declarations, ...
It turns out that the implementation is agnostic with respect to syntax,
And so case(a, b:c, d:e, f:g) works and so does infix("->");
case(a, b->c, d->e, f->g).
Further documentation is in the file. Someone looking into the evaluation
of mprog in maxima might make the program a little spiffier.
RJF
> -----Original Message-----
> From: maxima-bounces at math.utexas.edu [mailto:maxima-
> bounces at math.utexas.edu] On Behalf Of Michel Van den Bergh
> Sent: Sunday, January 07, 2007 11:22 AM
> To: maxima at math.utexas.edu
> Subject: programming, using op(), was ..RE: Bugfix for GosperSum?
> (was: cannot load Zeilberger)
>
> >
> > You could simulate it by case(expr,test,block([]....), test, .... I
> > suppose. Just wordier.
> The block statements are not necessary unless you want local variables
> and then you need "block"
> anyway.
>
> I think
>
> case (
> expr1, (
> statement1,
> statement2
> ), expr2, (
> statement1,
> statement2
> )
> )
>
> looks rather good. I don't like the square brackets. They are not used
> as delimiters elsewhere.
>
> Michel
>
>
>
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
-------------- next part --------------
A non-text attachment was scrubbed...
Name: casemac.lisp
Type: application/octet-stream
Size: 1884 bytes
Desc: not available
Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20070107/0fb9c104/attachment.obj