In a tacit definition you can access x and y with [ and ].  So in your
example, y (0=|) x gets your current output, and y (] #~ 0=|) x gets
your wanted output, as it will be parsed as (] #~ (0 = |)), so two forks.

On Thu Jul 7, 2022 at 1:24 PM CEST,  wrote:
> Hi,
>
> as a first step into the "land of J" I tried to build a fork(?) 
> to get a list of those numbers from a list, which can be devided
> by one given number .
>
> x is the one given number 
> y is the list of numbers to check/test
>
> The whole thing should work like this
>
> x <fork here> y
>
> What I have so far is 
> 0 = 3 #: 2 5 6 7 9 11 12
>     x    y--------------
>
> for all number, which can be divided by 3 it prints
> 0 0 1 0 1 0 1
>
> which is correct - but not the answer I wanted.
>
> I want to try this without using variables...this kind of solution
> is called "tacit" ... if I recall it correctly.
>
> My problem is, that the input list needs to be used twice and
> the result need to be refed into the whole thing again.
>
> The first time, y is used to calculate for each number y modulo x.
> The the result is checked for being "0" or not.
> And now I got stuck: How can I reapply y to the result to 
> filter all numbers, which are not divisable by x?
>
> If there is already a verb which does all that for me - I don't
> want to use it (for now), since I want to learn "how to J" :)
>
> Any help is very appreciated.
>
> And: Is a gordian knot in my head curable? ;)
>
> Cheers!
> Meino
>
>
>
>
>
>
>
>
>
>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm

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

Reply via email to