Zsban Ambrus <[EMAIL PROTECTED]> wrote: > On Fri, 30 Jun 2006, Mark D. Niemiec wrote: > > Dan Bron <[EMAIL PROTECTED]> wrote: > > > >> I see the identity of |~ is __ instead of _ : > >> > >> |~/'' > >> __ > > > > Actually, I am astonished at this; > > I would expect that f/'' to equal f~/'' for all f. > > Since |/'' is 0, |~/'' ought to be 0 also. > > I don't think so. (u/'') should produce the right identity of u, that is, a > noun y for which (x -: x u y) is always true; but (u~/'') should produce the > left identity of u. There are verbs like ^ where these two identities are > different.
This would be useful distinction to make. Unfortunately, J does not make the distinction between left and right identities. The dictionary says that the identity returned is either a right-identity or the left-identity. For example, 1 is returned for ^ (for which it is a right-identity, but for which no left-identity exists), but it is also returned for %: (for which it is a left-identity, but for which no right-identity exists). This also maintaina backwards-compatibility with APL's implementation of identities. I know there are some functions that have both identities, and in which the two are different, but I can't think of any at the moment. In such circumstances, it would probably be possible to extend J's definition to return distinct left- and right- identities for f// and f~// (while, for compatiblity, having both return the same values if only one identity exists) -- Mark D. Niemiec <[EMAIL PROTECTED]> ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
