On 9/14/07, neville holmes <[EMAIL PROTECTED]> wrote:
>  {.[.}.
> so that the adverb
> a =. {.[.}.
> would allow f a x to apply f between the head of x and the
> behead of x.  Similarly, x f a y would use x {. y and x }. y as
> arguments for f.

   a=: /(@({. ,: }.))
   + a 2 3 5 7
5 7 9
   2 + a 10^i.4
101 1010

> Other examples:
>
> b =. ] ,: [.   NB. adverb
>
> then f b x would stack x over f x and x f b y would stack y
> over x f y.

   b=: ^:0 1
   +/ b i.3
0 1 2
3 0 0
   3 *b 4
4 12


> There are ways of defining such adverbs and conjunctions
> without [. and ]. I suppose, but surely [. and ]. would make
> such constructs much easier to produce and understand.

J's [. and ]. (before they were omitted) did not seem to produce
easy to understand expressions.  (The style used in my 'a',
above, is somewhat representative of how you would use those
symbols -- though a is somewhat simpler than those kinds of
examples.)

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to