It seems to me that you should write and share what you want:
m2=: 13 :'y++y'
d2=: 13 :'x+x+y'
And get what you want:
m2 3 4 5
6 8 10
1 2 3 d2 3 4 5
5 8 11
But you get some additional bonuses:
1 2 3 m2 3 4 5
7 10 13
d2 3 4 5
6 8 10
And "lo and behold" J thinks they are the same.
m2
] + +
d2
[ + +
Linda
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of bill lam
Sent: Thursday, November 26, 2015 12:12 AM
To: 'Pascal Jasmin' via Programming
Subject: Re: [Jprogramming] dyadic J
A long tacit train of symbols can be difficult to parse especially when we
don't know whether its usage is monad or dyad.
examples in J Phrases give hints like this,
m1=: [ + +
d1=: [ + +
Ср, 25 ноя 2015, jprogramming написал(а):
> > Also the primitives addon can not translate from symbols to
> > namedverbs automatically because valency is unknown until actual
> execution.
>
> That's what I remember, and the primitives addons workaround is to give 2
> names to each builtin verb, and IndexOf 5 is valid even if nonsensical.
>
> Your proposal is a completely reasonable alternative, but its less convenient
> and requires more typing effort.
>
> Consider Conjugate
>
> 3 ([ + +) 3j4
> 9j4
> 3 ([ + +@]) 3j4
> 6j_4
> ([ + +) 3j4
> 6
>
> all are valid ambivalently, but if you intended the 2nd and 3rd vs 1st and
> 3rd then:
>
>
> ([ + conjugate) captures that intent. (includes option of no
> whitespace)
>
>
> with your proposal you would have to write either
>
> ([ + Conjugate@])
>
> or
>
> (Right Plus Plus) NB. if 2nd meaning intended
>
>
> but that 2nd one is only valid if you call it dyadically and it doesn't have
> any of the 3 mentioned meanings:
>
> 0 ([ + +) 3j4
> 3j4
> 0 (] + +) 3j4 NB. required call to match original monad.
>
> so that is another advantage to leaving the dyad primitives alone. You can
> still make ambivalent verbs, and the dyad case may be the main ambivalent
> intent.
>
>
> ----- Original Message -----
> From: bill lam <[email protected]>
> To: 'Pascal Jasmin' via Programming <[email protected]>
> Sent: Wednesday, November 25, 2015 11:40 AM
> Subject: Re: [Jprogramming] dyadic J
>
> I think ambivalent is difficult and not that intuitive for uninitiated
> users. Perhaps J (and APL) needed ambivalent partly because there were
> not enough symbols. Making named verbs either monad or dyad but not
> both, might make life of new users easier. eg.
>
> til =: i. : [:
> til 5
> 0 1 2 3 4
> 1 til 5
> |domain error: til
> | 1 til 5
> indexOf =: [: : i.
> 1 2 3 indexOf 2
> 1
> indexOf 2
> |domain error: indexOf
> | indexOf 2
>
> Also the primitives addon can not translate from symbols to named
> verbs automatically because valency is unknown until actual execution.
>
>
> --
> regards,
> ====================================================
> GPG key 1024D/4434BAB3 2008-08-24
> gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3 gpg --keyserver
> subkeys.pgp.net --armor --export 4434BAB3
>
>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3 gpg --keyserver
subkeys.pgp.net --armor --export 4434BAB3
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm