[Matrix-SIG] functions for numbers & arrays

David Ascher da@skivs.ski.org
Thu, 2 Apr 1998 16:31:58 -0800 (PST)

I'm getting annoyed at the fact that, as mentioned previously on this list
(I believe it was Konrad, eons ago), it's hard to write functions which
work for both arrays and lists.  For example, I have functions which I
want to evaluate at grids of parameter values (x = arange(2,4,.2),
y=arange(1,2,.01)) and specific points (x = 2, y = 3).

I haven't come up with a good way to do this that does the right thing in
most circumstances.  [for example, I'd like such a function to return an
array in the first case, but a scalar in the second]

What do other array languages do to address this problem?  Anything we can