On Fri, Jul 20, 2012 at 12:05 AM, Ian Clark <[email protected]> wrote: > For all my exposure to J, I can't answer the following simple(?) > questions. Can someone help please? > > Take the fully parenthesized representation of a given tacit verb: foo > (viz 5!:6 <'foo') > --note: "verb", not "sentence" (which might be a noun). > Take what's inside any pair of balanced parens: (...). Give it a name: > baa, so we can formally replace (...) with (baa) . > > 1. Is baa always a verb? > Answer: no, because I can make phrases like: (-~) appear. > BUT are there only a small number of special cases I can detect > and allow for, like (-~)?
-~ is a verb > 2. If baa is not a verb, how can I determine its type? > -short of actually assigning it to a local name: baa=. (...) and > calling 4!:0<'baa' ? What's wrong with that? > 3. Is there an easy way to tell if baa gets called monadically or > dyadically, and if it gets the y-argument of foo -- and the x-arg too? Not in the general case. Consider: example=: +/@:(#.inv) Here, we can use the monadic or the dyadic definitions of #.inv, depending the context where example is used. That said, some contexts will provide adequate restrictions. For example, we only care about the monadic definition of the left argument for @ or for the right argument of & (assuming it's a verb). -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
