[sage-devel] presentation about Maxima at Sage developer days



On Fri, Jun 20, 2008 at 1:06 AM, Richard Fateman
<fateman at cs.berkeley.edu> wrote:
> hmm .. except if you insist on infix for X/Y, I think lisp is pretty good.
> I especially prefer cond   to nested if/elseif/....  I think it is more
> readable below.
>
>  Also, in Python, is c global or local?  If it is global, it would seem to
> be an error in the python program.

"c" is local.

> Here's a shorter lisp, using &aux to establish a local binding, instead of
> (let ...)..  I don't usually use &aux
> but if we are talking "short"...  Of course in lisp this can all be on one
> line. The indentation is suggested by the editor or the author, not
> required.
>
> (defun compare(a b x &aux (c (limitinf (/ (log a) (log b)) x)))
>  (cond ((= c 0) '<)
>       ((member c '(inf minf)) '>)
>       (t '=)))

Of course, it's a matter of taste, some people prefer lisp, some
python, but the point is that
our examples show that you can do the same both in lisp and python on
around the same lines of code, so it doesn't
really matter which language you choose from this perspective.

Ondrej