Let me make up a term and call it "ambivalent coherence".  Referring to a 
function that behaves coherently under both monad and dyad use.  Where coherent 
is defined as the only mental effort required to know the monad form is 
substitution of a default parameter for x.

- % ^ ^. all have ambivalently coherent implementations (default x of 0 1 e e). 
 Addition and multiplication do too, but they are too boring and duplicate 
(Same ]).  In J's design it was thought to be a waste to not reuse the symbols 
+ * for something useful monadically too.

although ambivalent coherence is a binary - pregnancy like- condition,


* # $ have relatively low "ambivalent incoherence"  The monads are incoherent 
to their dyads, but there is a functional relationship.  There is also some 
coherence with how the 3 verbs differ monad from dyad. The conjunction 2 : 'u@] 
u v'  could likely be meaningful where u can be any of the 3.

dyadic J is the simple naming of ambivalently incoherent monads.  To tweak your 
definitions slightly,


m1=: ] + +@]
d1=: ] + +

Both of those verbs are "ambivalently valid" (return without error, and have 
practical "meaningful intentionality" under both monad and dyad).  They are (as 
whole verbs) also ambivalently coherent as long as the domain is not imaginary 
numbers.  They both produce the same answer if called monadically, for any 
domain.

So the "m and d" hints are not actually appropriate for what are ambivalently 
valid verbs.  To make them appropriate we would need to unnecessarily force a 
domain error.

dyadic J makes it easier to compose ambivalently coherent expressions, and 
easier to read the ambivalent intent.

conjugate =: +@]
m1=: ] + conjugate

(d1 * m1) can also be "intentionally ambivalently valid" and coherent with dyad 
x of 0 and y not imaginary.





----- Original Message -----
From: bill lam <bbill....@gmail.com>
To: 'Pascal Jasmin' via Programming <programm...@jsoftware.com>
Sent: Thursday, November 26, 2015 12:12 AM
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 <bbill....@gmail.com>
> To: 'Pascal Jasmin' via Programming <programm...@jsoftware.com>
> 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

Reply via email to