Would you expect the last line of
1+i.2
1 2
1+i.1
1
1+i.0
to be a domain error? If not, then consider:
''-:i.0
1
So if 1+i.0 shouldn't raise an error, then neither should 1+'' , because
i.0 and '' are "the same thing".
Another way of putting it is that there are no instances of domain coflicts in
executing 1+'' . This is the same reason
''-:i.0 . To wit: no items differ.
.. there are no atoms which are different.
.. the number of different atoms is 0.
Your observation using the verb foo is (mostly) unrelated. If a verb is
called with an empty argument (the shape of the
argument contains a 0 (ie e.&0@:$ )), then J will execute that verb on some
fill elements.
J only cares about the shape of the output from that call; all other aspects of
the output, including errors, are ignored (CAVEAT:
SIDE EFFECTS STILL OCCUR). J does this so it can properly shape the output of
the verb, to seamlessly handle the edge conditions,
so that you don't have to.
I don't remember where this is stated or implied in the DoJ, but I can find the
quotes if you like. I'm pretty sure Henry Rich
made it explicit and clear in "J for C Programmers".
-Dan
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm