Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!udel!haven.umd.edu!socrates.umd.edu!socrates!rockwell From: rockwell@socrates.umd.edu (Raul Rockwell) Newsgroups: comp.lang.apl Subject: Re: Forks, Hooks and With in J Message-ID: Date: 3 Jun 91 13:49:28 GMT References: Sender: rockwell@socrates.umd.edu (Raul Rockwell) Organization: Traveller Lines: 26 In-Reply-To: kjell@ygdrasil.ucsc.edu's message of 3 Jun 91 10: 17:53 GMT Kjell E Post: I've ordered the Tangible Math book and started to program in J, but find the use of & (with) confusing, especially in conjunction with forks and hooks. For instance, (0&,) and (,&0) seems to represent the trees , , / \ / \ 0 0 respectively. Is there any reason why this notation was chosen, i.e. what is the underlying functionality of '&'? Forks and hooks are types of verb phrases. Given a verb phrase of the form v1 v2 v3 a fork will be constructed, and given a verb phrase of the form v2 v3 a hook will be constructed. "Trees" involving 0 or & are neither forks nor hooks (0 is a noun and & is an adverb). The "underlying functionality" of & is, roughly, that of binding an object to a function. If you bind a noun to a verb, as above, you create an intransitive verb derived from the transitive form of the original verb. If you bind a verb to a verb v1&v2 then the intransitive form of v2 is used as a preprocessor for v1 (the distinction between the transitive and intransitive form for v1 is determined from context). Raul Rockwell