[Maxima] About submatrix and its meaning
ko at research.att.com
Sat Nov 21 10:06:06 CST 2009
How about a question mark? E.g. "x?listp".
foo(P(x)) is too much like f(g(x)), function composition.
Robert Dodier wrote:
> On Wed, Nov 18, 2009 at 3:16 AM, Leo Butler <l.butler at ed.ac.uk> wrote:
>> To amplify RJF's comment...
>> It would be nice if Maxima had a function devoted to argument checking
>> (q: does it, and I am ignorant?), or even better, if it understood the
>> foo(x::list) := ....
> I'm in favor of such a feature, which could be put in place with
> modest effort and without messing up any existing function definitions.
> However, since "::" already means something (it's an assignment
> operator) I'd rather see a different notation.
> How about
> foo (P(x)) := ...
> where P is some predicate e.g. listp, integerp, symbolp, etc.
> possibly including lambda expressions for good measure.
> I think that's very much preferable to burdening the function
> definition with boilerplate code like: if not listp(x) then error("Rats!");
> Robert Dodier
> Maxima mailing list
> Maxima at math.utexas.edu
More information about the Maxima