detecting lisp overflow



On Sun, Mar 17, 2013 at 5:02 PM, Edwin Woollett <woollett at charter.net>wrote:

> ...By the way, what is going on with Maxima's string function when you
> try to use it in lisp:
>
> (%i1) string(abc);
> (%o1) "abc"
> (%i2) :lisp ($string 'abc)
> Maxima encountered a Lisp error:
>
> Error in PROGN [or a callee]: The function $STRING is undefined.
>

STRING is a Maxima quoting function (an MFEXPR*), and is thus understood by
the Maxima evaluator and not the Lisp evaluator.

As usual with MFEXPR*'s, it has "convenience" properties which make its
semantics irregular:

block([simp:false], unsimp: 1+1)$
unsimp => 2                  -- simplifies with SIMP turned back on
string(unsimp) => 1+1    -- string is being clever
test:5  => 5                    -- normal semantics
string(test:5) => test:5    -- string is being clever

In this case, I can't think of many realistic cases which would be
problematic, but then, I can't think of cases where this would actually be
convenient....

           -s