Skip to content
Prev 3987 / 63424 Next

design question

Bill Venables <venables@acland.qld.cmis.csiro.au> writes:
We do have a couple of cases where we allow expressions instead of
functions of one variable, with "x" marking the spot of the
indep.var., e.g. curve(exp(x)) works that way.

In principle we could allow a similar convention for functions of two
variables, e.g. outer(u, v, x^2 + y^2). There are various nasty
pitfalls in the kind of code needed to support this, though: For
instance, writing a function that passes its argument on to curve()
needs to do it with substitute() magic and evaluation in parent
frames. Also take a look at the beginning of curve() for the
contorsions the code needs to go through to handle the non-function
cases. On the whole, I'm not sure this kind of apparent
user-convenience is worth it.

BTW, we also have positional TeX-style arguments, but fortunately
nobody knows about them:
[1] 13