[Jprogramming] Repeated application of a verb
David Vaughan
purpleblues13 at googlemail.com
Sun Oct 9 01:01:21 HKT 2011
Thanks, I understand it now, and it works.
On 8 Oct 2011, at 17:34, Raul Miller wrote:
> On Sat, Oct 8, 2011 at 12:19 PM, David Vaughan
> <purpleblues13 at googlemail.com> wrote:
>> Could you maybe explain how that tacit verb works (and how it works with 'verb')? Is it something along the lines of, see if the input is not a member of trigger, multiply with trigger to get 0 0 or outp1 outp2, ... then I run out of ideas. :P
>>
>> On 8 Oct 2011, at 15:58, R.E. Boss wrote:
>>
>>> trigger=: outp1, outp2
>>>
>>> verb ^: (trigger */@:-. at e.~ ])^:_ input
>
> outp1=: 2
> outp2=: 5
> trigger=: outp1, outp2
>
> trigger e.~ 2 3 5 7
> 1 1
> trigger e.~ 1 2 3 4
> 1 0
> trigger e.~ 5 6 7 8
> 0 1
> trigger e.~ 9 10 11 12
> 0 0
>
> -.1 1
> 0 0
> -.1 0
> 0 1
> -.0 1
> 1 0
> -.0 0
> 1 1
>
> */0 0
> 0
> */0 1
> 0
> */1 0
> 0
> */1 1
> 1
>
> So (trigger */@:-. at e.~ ]) is 1 when neither element of trigger is
> present in its right argument and 0 otherwise.
>
> Meanwhile verb does whatever you need it to do (but you have not said
> what that is yet, so we cannot make any useful suggestions there).
>
> FYI,
>
> --
> Raul
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
More information about the Programming
mailing list