[Jprogramming] Repeated application of a verb
Raul Miller
rauldmiller at gmail.com
Sun Oct 9 00:34:31 HKT 2011
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
More information about the Programming
mailing list