argument checking, was: About submatrix and its meaning
Subject: argument checking, was: About submatrix and its meaning
From: Steve Haflich
Date: Sun, 22 Nov 2009 20:09:41 -0800
Richard Fateman <fateman at cs.berkeley.edu> wrote:
How about
foo(x,y,??x>y):= ....
so the predicate can involve all the parameters.
Note also the possibility of extending this idea to function
discrimination based on types or predicates
myabs(x??x>0):=x;
myabs(x??x<=0):= -x;
which brings us closer to (for example) common lisp object system, and
incidentally to Mathematica.
Before you go much further with this ;language extension, I suggest you
think carefully about the operator precedence of this new ?? operator.
There might be unexpected parsing surprises if the test predicates
become more complex.