Thanks David,

Good explanations. Just last week, it dawned on me that there are four 
different meanings of [  ,  [  ,  ] and ] .

That makes tacit to explit more challenging .

Linda






Sent from my Verizon, Samsung Galaxy smartphone
-------- Original message --------
From: David Lambert <[email protected]>
Date: 5/5/19 2:50 PM (GMT-05:00)
To: programming <[email protected]>
Subject: Re: [Jprogramming] ambivalent tacit verb with Self-Reference

Task: write f explicitly.

f=:(0 ,.~ 0 ,. 0 ,~ 0 , ])^:[

We try substituting x and y for [ and ] .

    g=: 13 :'(0 ,.~ 0 ,. 0 ,~ 0 , y)^:x'

    2 g i. 2 3
|domain error: g
|   (0,.~0,.0,~0,y)    ^:x


We see failure with power.
We look up power in NuVoc
[x] u^:n y     Fixed Power     Conjunction

Oh!  ^: requires a non-noun on its left (u) and a noun y to the right (n).
j computes (0 ,.~ 0 ,. 0 ,~ 0 , y) as a noun, and sure enough, domain error.

We might choose

g=: 13 :'(0 ,.~ 0 ,. 0 ,~ 0 , ])^:x y'

or

frame=: 13 :'(0 ,.~ 0 ,. 0 ,~ 0 , y)'
h=: 13 :'frame^:x y'



    NB. successful tests, g and h match f.

    (i.8) (g -: f)"0 _ i. 2 3
1 1 1 1 1 1 1 1

    (i.8) (h -: f)"0 _ i. 2 3
1 1 1 1 1 1 1 1

At least, that's how I did it, and I probably shouldn't show this version

explicit_f =: dyad define
  result =. y
  for_repetition. i. x do.
   a =. 0 , result
   b =. a , 0
   c =. b ,. 0
   result =. 0 ,. c
  end.
)

> Date: Sun, 5 May 2019 07:36:11 +0000
> From: Linda Alvord<[email protected]>
> To:"[email protected]"  <[email protected]>
> Subject: Re: [Jprogramming] ambivalent tacit verb with Self-Reference
> Message-ID:
>        
> <byapr10mb37353d62a16c9d17d4e6dbe3b5...@byapr10mb3735.namprd10.prod.outlook.com>
>
> Content-Type: text/plain; charset="utf-8"
>
> Here's a simple function:
>
> f=:(0 ,.~ 0 ,. 0 ,~ 0 , ])^:[
>
>     3 f i.3 4
> 0 0 0 0 0  0  0 0 0 0
> 0 0 0 0 0  0  0 0 0 0
> 0 0 0 0 0  0  0 0 0 0
> 0 0 0 0 1  2  3 0 0 0
> 0 0 0 4 5  6  7 0 0 0
> 0 0 0 8 9 10 11 0 0 0
> 0 0 0 0 0  0  0 0 0 0
> 0 0 0 0 0  0  0 0 0 0
> 0 0 0 0 0  0  0 0 0 0
>
> But, oddly, I can't define this function explicitly.
>
> Linda
>
> -----Or
----------------------------------------------------------------------
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%7C902eb8ca78e4450df1e208d6d18a7c30%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636926790055307874&amp;sdata=JW5%2BBe69q9Ae5b49k0oEIGKXBxPS2dtSbEMkLnPREXM%3D&amp;reserved=0
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to