Here's the comparison I was trying to make.  3 :  and  4 : will not be tacit,
But 13 : will become tacit if it can.

alpha1=: 4 :'y /: <./x i."1 _ y' 
      
   alpha=: 13 :'y/:<./x i."1 2 y'
   
   alpha1
4 : 'y /: <./x i."1 _ y'
   
   ;:'4 : ''y /: <./x i."1 _ y'''
┌─┬─┬────────────────────┐
│4│:│'y /: <./x i."1 _ y'│
└─┴─┴────────────────────┘
            
    alpha 
] /: [: <./ i."1 2
   
   ;:'] /: [: <./ i."1 2'
┌─┬──┬──┬──┬─┬──┬─┬───┐
│]│/:│[:│<.│/│i.│"│1 2│
└─┴──┴──┴──┴─┴──┴─┴───┘

The us of words emphasizes the differences.

Thanks for teaching me about  4 :

Linda

-----Original Message-----
From: Programming <[email protected]> On Behalf Of 
'robert therriault' via Programming
Sent: Tuesday, August 7, 2018 6:14 PM
To: [email protected]
Subject: Re: [Jprogramming] monadic/dyadic verb defintion

By the way you can also declare this tacitly using a similar technique

   alpha1t=:  ([:) : ( ] /: [: <./  i."1 _ )
   5!:2 <'alpha1t'
┌──┬─┬─────────────────────────────┐
│[:│:│┌─┬──┬──────────────────────┐│
│  │ ││]│/:│┌──┬──────┬──────────┐││
│  │ ││ │  ││[:│┌──┬─┐│┌──┬─┬───┐│││
│  │ ││ │  ││  ││<.│/│││i.│"│1 _││││
│  │ ││ │  ││  │└──┴─┘│└──┴─┴───┘│││
│  │ ││ │  │└──┴──────┴──────────┘││
│  │ │└─┴──┴──────────────────────┘│
└──┴─┴─────────────────────────────┘
   aA alpha1t fruits
Fig
Kiwi
Peach
Pear

Cheers, bob
 

> On Aug 7, 2018, at 2:54 PM, 'robert therriault' via Programming 
> <[email protected]> wrote:
> 
> Hi Linda,
> 
> I am using this thread to reply to your question in order to get off the 
> thread that Henry and Bill are using for their debugging conversation.
> 
> You asked:
> 
>  Thanks. However, I was trying to use the example to show the differences 
> between an explicit definition using 3 : and a tacit version using  13 : . 
>       
>  Is there a way to show my explicit definition as is usually the way 3 : 
> works?
> 
>  Linda
> 
> I think that if you are looking for a way to define a dyadic verb 
> using 3 : in one line - the way to do it is to box the multiline verb 
> so that each box represents a line. The first line of the monadic case 
> is [: which means that it is not going to work monadically at all. Sp 
> when the parser moves along the line and gets to
> 
> alpha1 fruits
> 
> it will know that this is not a monadic verb and moves on to
> 
> aA alpha1 fruits
> 
> which it can process. Without the [: it tries to process the monadic form and 
> gives you your domain error. 
> 
> The following creates a one line explicit verb that works.
> 
>    ('[:';':';'y /: <./x i."1 _ y') NB. boxed script 
> ┌──┬─┬──────────────────┐ │[:│:│y /: <./x i."1 _ y│ 
> └──┴─┴──────────────────┘
>   alpha1=: 3 : ('[:';':';'y /: <./x i."1 _ y')
>   aA alpha1 fruits
> Fig
> Kiwi
> Peach
> Pear
> 
> Cheers, bob
> 
>> On Aug 7, 2018, at 7:47 AM, Brian Schott <[email protected]> wrote:
>> 
>> Linda,
>> 
>> Try alpha2 instead of alpha1 to circumvent the domain error because 4 
>> signals a dyadic verb.
>> 
>> alpha1=: 3 :'y /: <./x i."1 _ y'
>> alpha2=: 4 :'y /: <./x i."1 _ y'
>> 
>> It's a little puzzling what you are trying to do because the 
>> following gives a similar result.
>> 
>>  /:~fruits
>> Fig
>> Kiwi
>> Peach
>> Pear
>> 
>> (If this question has already been answered, I am sorry to clutter 
>> the mail
>> list.)
>> --
>> (B=) <-----my sig
>> Brian Schott
>> ---------------------------------------------------------------------
>> - For information about J forums see 
>> https://eur04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.
>> jsoftware.com%2Fforums.htm&amp;data=02%7C01%7C%7Cc2f83467f45e4512d4b2
>> 08d5fcb32d1b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C63669276883
>> 5655749&amp;sdata=XxFofH05nvg5pwJ4oQPug0YxGyB3yes4Xx8rnfxqSTI%3D&amp;
>> reserved=0
> 
> ----------------------------------------------------------------------
> For information about J forums see 
> https://eur04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.j
> software.com%2Fforums.htm&amp;data=02%7C01%7C%7Cc2f83467f45e4512d4b208
> d5fcb32d1b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C63669276883565
> 5749&amp;sdata=XxFofH05nvg5pwJ4oQPug0YxGyB3yes4Xx8rnfxqSTI%3D&amp;rese
> rved=0

----------------------------------------------------------------------
For information about J forums see 
https://eur04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.jsoftware.com%2Fforums.htm&amp;data=02%7C01%7C%7Cc2f83467f45e4512d4b208d5fcb32d1b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636692768835655749&amp;sdata=XxFofH05nvg5pwJ4oQPug0YxGyB3yes4Xx8rnfxqSTI%3D&amp;reserved=0
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to