On Wed, Jun 13, 2012 at 1:53 PM, Thomas Costigliola <[email protected]> wrote: > What is the right argument to IntrinsicRank supposed to be? For example in > > fibonacci=:3 :0 b: 0 > y{(,+/@{.~&_2)^:(>./,y) 0 1 > ) > > what does the 0 actually do?
It's the same as the right argument to the rank conjunction. > If you want the user to be able to inform the interpreter that a J > verb can efficiently compute its result over different ranks then it > seems to me that you would need the following: > > 1. A flag marking the derived verb as having IRS. > 2. The implementation of rank checks the flag and if it is marked rank > does not handle the the creation of the result cells but instead > passes the entire argument to the verb. > 3!. But now the verb needs to know at what rank it is being called. So > there needs to be a way to pass that to the J verb. I don't know how > this would happen; maybe 9!: foreign that returns the rank? The underlying integrated rank support mechanism already exists in the interpreter (though the current implementation is not yet adequate for this proposal). The implementation of an integrated rank support conjunction would throw an error if the verb did not properly behave at the declared rank. Any remaining issues would be dealt with by the programmer. Note that the user supported mechanism should not need to be told what rank has been declared for it. I think you should instead think of this as a declaration about the contained definition for the benefit of the rest of the system. In other words, what I am proposing is much more constrained than the mechanism supported by the interpreter (where, if I understand properly, use of "n will be handled by the primitive). I just want a mechanism to declare an effective rank for the derived verb which is different from the implementation rank. Thanks, -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
