Is it possible to define f tacitly?

f=: 3 : '({.@:>@:{.y)`:0 (>@:}.y)'
f (+:`*:;i.5)

0 2 4 6 8

It's meant to take the first gerund from a box that contains a list of
gerunds and data to operate on

It's an odd circumstance that needed it. I could probably rework the
logic but now I'm curious if it can be done

Some things I tried:

a=:(+:`*:;i.5)

f1=:{.@:>@:{.
   f1 a
┌──┐
│+:│
└──┘

f2=:>@:}.
  f2 a
0 1 2 3 4


Tried various version of combining f1 and f2 to no avail

This works:

   g`:0 f2 a [ g=. f1 a
0 2 4 6 8

I'm thinking there might be a way to do it without the assignment?
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to