p j wrote: > I'd also need to know whether specific > conjunctions/adverbs evaluate to a verb or noun (after > their arguments processed). I'm guessing there's only > 2 ways to find out: 1. execute the conjunction (not > safe obviously), or 2. Would need J support for > classifying user-defined conjunctions by their > possible return types.
In general, the only completely valid way to determine adverb/conjunction result type is to evaluate the adverb or conjunction. J itself does not know except through evaluation. However, you don't have to be completely general when transforming programs. It's perfectly alright to punt at some point -- you don't have to solve the halting problem, you just need to document where you give up. A classic example of a conjunction which can return any of the four major syntactic types is : 0 :'', 1 :'', 2 :'' and 3 :'' all have different syntactic types (by the way: all these functions have empty domains because none produce a result -- but it's the : conjunction I'm using as an example here, not the result of :). A slightly more abstract case of this would be 2 :'m :n' -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
