Thanks Henry

   po=: 13 :'|:y#:i.*/y'

   
   po2=: 3 :'|:y#:i.*/y'
   
   po
[: |: ] #: [: i. */
   
   po2
3 : '|:y#:i.*/y'
   
   5!:4 <'po'
  ┌─ [:               
  ├─ |:               
──┤    ┌─ ]           
  │    ├─ #:          
  └────┤    ┌─ [:     
       └────┼─ i.     
            └─ / ─── *
   5!:4 <'po2'
      ┌─ 3             
── : ─┴─ ,:'|:y#:i.*/y'
   
   
   ,:'|:y#:i.*/y'
|:y#:i.*/y
   
   $,:'|:y#:i.*/y'
1 10
   
   ;:',:''|:y#:i.*/y'''
┌──┬────────────┐
│,:│'|:y#:i.*/y'│
└──┴────────────┘
   
 ;:'|:y#:i.*/y'  
┌──┬─┬──┬──┬─┬─┬─┐
│|:│y│#:│i.│*│/│y│
└──┴─┴──┴──┴─┴─┴─┘
 

Itemize and words! Now I can go to sleep!


Linda
  

-----Original Message-----
From: Programming <[email protected]> On Behalf Of Henry 
Rich
Sent: Saturday, July 27, 2019 9:54 PM
To: [email protected]
Subject: Re: [Jprogramming] Learning Tacit Programming

The body of the explicit verb is considered to be a list of lines, i. e. 
a rank-2 array of characters.

Henry Rich

On 7/27/2019 7:50 PM, Linda Alvord wrote:
> It seems not to matter that 1 is in parentheses:
>
>     g=:13 :'1 x}y'
>        
>     1 3 5 g i.10
> 0 1 2 1 4 1 6 7 8 9
>     
>     g
> 4 : '1 x}y'
>
> But hee is a surprise.
> Itemize (,:y) shows up.
>
>     5!:4 <'g'
>        ┌─ 4
> ── : ─┴─ ,:'1 x}y'
>     
>     $'1 x}y'
> 5
>     
>     $,:'1 x}y'
> 1 5
> Why is this here?
>
> Linda
>     
>
>
> -----Original Message-----
> From: Programming <[email protected]> On Behalf 
> Of Roger Hui
> Sent: Saturday, July 27, 2019 1:06 AM
> To: [email protected]
> Subject: Re: [Jprogramming] Learning Tacit Programming
>
> 13 : '(1) x}y'  or  13 : '1 x}y'  can not be made tacit because they use a 
> function argument (x) as an operand.  Similarly 13 : '+/"y x' or 13 : '+/"x 
> y' can not be made tacit either.
>
> Why not, you might ask?  The sequence for an operator is that you _first_ 
> derive a function, and _then_ the function is applied to function arguments x 
> and/or y .  When you say x} or +/"x  or +/"y , at that point you don't yet 
> have the function argument.
>
>
>
> On Fri, Jul 26, 2019 at 9:40 PM Devon McCormick <[email protected]> wrote:
>
>> I am intrigued by tacit programming but agree with Henry that you 
>> should drink the Kool-Aid with slow, measured sips.
>>
>> I continue to rely heavily on "13 : .." (to the dismay of tacit
>> die-hards) but still puzzle over why certain expressions cause it to give 
>> up, e.g.
>>
>>     13 : '(1) x}y'
>> 4 : '(1) x}y'
>>
>> Yet this works
>>     x=. 2 4 6
>>     y=. i.10
>>     (1) x}y
>> 0 1 1 3 1 5 1 7 8 9
>>
>> Whereas these do not:
>>     x ((1) [}]) y
>> 0 1 2 3 4 5 6 7 8 9
>>     x ((1)& [}]) y
>> 0 6 2 3 4 5 6 7 8 9
>>
>>
>> On Fri, Jul 26, 2019 at 11:53 PM Henry Rich <[email protected]> wrote:
>>
>>> Yes, you have to think differently.
>>>
>>> Please, don't make a fetish of tacit programming.  The important 
>>> thing about becoming a J programmer is training yourself to look at 
>>> the whole problem rather than working with atoms.  That is, getting 
>>> over the loop mindset.
>>>
>>> Problem: You have an array a and you want to apply a linear function
>>> y=3x+1 to every atom.  How do you do it?
>>>
>>> 0. (3 * a) + 1
>>> Bravo! You didn't have to loop.  Full marks.
>>>
>>> 1. 1 + 3 * a
>>> Piu bravo!  You are thinking right to left.
>>>
>>> 2. (1 + 3&*) a
>>> Bravissimo!  You have written a little bit of tacit code.  You could 
>>> also have written (1 + 3 * ]) a
>>>
>>> 3. 1 3 p. a
>>> Congratulations, you have reached master level.  Let the interpreter 
>>> sweat the details.
>>>
>>>
>>> My very first J program was a model of texture processing for a 
>>> computer-graphics system.  I imbibed the tacit liquor too deeply, 
>>> and wrote the whole thing as a sequence of tacit verbs, 50 of them.
>>> It worked.  It was absolutely unmaintainable.  Don't go there.
>>>
>>> Use tacit verbs for problems whose spec is mathematically unchangeable.
>>> For everything else, use explicit verbs.
>>>
>>> Henry Rich
>>>
>>>
>>>
>>>
>>>
>>> On 7/26/2019 7:20 PM, The3DSquare Josh Yang wrote:
>>>> I was wondering if you guys have any resources for learning tacit 
>>>> programming in J. I've been struggling with tacit programming, 
>>>> probably because all the other programming languages are mainly explicit.
>>> Something
>>>> like "Tacit programming for the explicit programmer" would be great
>>> since I
>>>> often fail to derive the tacit equivalent of a series of explicit 
>>>> eeaxpressions (especially when there are mutable variables).
>>>>
>>>> I know I need to think differently, but having some guidance would 
>>>> help greatly.
>>>> ------------------------------------------------------------------
>>>> ---- For information about J forums see http://w 
>>>> ww.jsoftware.com%2Fforums.htm&amp;data=02%7C01%7C%7Cbee23238788f4c
>>>> 6797a408d712502b9c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C63
>>>> 6998007844844113&amp;sdata=1N2L%2BXvxZpRcW5HmcfClWxo9xt%2Fi%2BYJXc
>>>> WkdRSmMDs8%3D&amp;reserved=0
>>>
>>> ---
>>> This email has been checked for viruses by AVG.
>>> https://ww
>>> w.avg.com&amp;data=02%7C01%7C%7Cbee23238788f4c6797a408d712502b9c%7C8
>>> 4df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636998007844844113&amp;sda
>>> ta=XcPRZc2FCxfsXOitXh4CazEAK4rJ2icX5c5Vpj9xIsw%3D&amp;reserved=0
>>>
>>> --------------------------------------------------------------------
>>> -- For information about J forums see http://www
>>> .jsoftware.com%2Fforums.htm&amp;data=02%7C01%7C%7Cbee23238788f4c6797
>>> a408d712502b9c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C63699800
>>> 7844844113&amp;sdata=1N2L%2BXvxZpRcW5HmcfClWxo9xt%2Fi%2BYJXcWkdRSmMD
>>> s8%3D&amp;reserved=0
>>>
>>
>> --
>>
>> Devon McCormick, CFA
>>
>> Quantitative Consultant
>> ---------------------------------------------------------------------
>> -
>> For information about J forums see
>> http://www.j
>> software.com%2Fforums.htm&amp;data=02%7C01%7C%7Cbee23238788f4c6797a40
>> 8
>> d712502b9c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C6369980078448
>> 4 
>> 4113&amp;sdata=1N2L%2BXvxZpRcW5HmcfClWxo9xt%2Fi%2BYJXcWkdRSmMDs8%3D&a
>> m
>> p;reserved=0
>>
> ----------------------------------------------------------------------
> For information about J forums see 
> https://nam05.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.j
> software.com%2Fforums.htm&amp;data=02%7C01%7C%7C2dc849104c544033d36908
> d712fe7d8c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C63699875654556
> 1370&amp;sdata=2f8RmVnYf1usHOgxXYzUlPCGAb4ImlllUyQTFUCDoZA%3D&amp;rese
> rved=0
> ----------------------------------------------------------------------
> For information about J forums see 
> https://nam05.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.j
> software.com%2Fforums.htm&amp;data=02%7C01%7C%7C2dc849104c544033d36908
> d712fe7d8c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C63699875654557
> 1356&amp;sdata=nluQdLwFY2SJOuZH2Hm80R%2FZSr0Y8o3Zwj2kSjm4rUg%3D&amp;re
> served=0


---
This email has been checked for viruses by AVG.
https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.avg.com&amp;data=02%7C01%7C%7C2dc849104c544033d36908d712fe7d8c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636998756545571356&amp;sdata=030eA%2FvjvICsekqjJ7B5xRJYPHVwakHS7nKL5MmcApU%3D&amp;reserved=0

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

Reply via email to