Kip and Erling wrote  f and  g .  Both are written in simple  J .  Now work
backwards to provide the explicit expressions to provide each one.

    A=:' ads   sd s   '
      
   g=: 2 }. [: (#~ ((' ' ~: {:) ,~ [: -. '  ' -:"1 }: ,. }.)) 'z  ' , ]
      
   f=:[: ((' ' = {.) }. ]) [: ((_1 * ' ' = {:) }. ]) ([: (] +. $ {. 1 , }:)
' ' ~: ]) # ]
     
   (f-:g)A
1
   
   (f-:g)|.A
1


I find the trees to be helpful in this exercise.  Actually as a math
teacher, I would introduce J with explicit sentences as knowing where x and
y are at the beginning of learning is important.  This goes hand in hand
with algebra.

Linda


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Erling
Hellenäs
Sent: Wednesday, July 16, 2014 4:05 AM
To: [email protected]
Subject: Re: [Jprogramming] Design goals readability and write, ability?

i.

i.
DropRedundantBlanksM
[: ((' ' = {.) }. ]) [: ((_1 * ' ' = {:) }. ]) ([: (] +. $ {. 1 , }:) ' 
' ~: ]) # ]

/Erling

On 2014-07-15 22:43, David Lambert wrote:
> Each j verb (unless locked, I presume) tells its definition.  One of 
> my favorite j features.
>
>    f''
> hi world!
> hi world!
> hi world!
>
>    f
> 3 : 'for_i. i.3 do. smoutput ''hi world!'' end.'
>
>
> And in python,
> >>> f()
> hi world
> hi world
> hi world
> >>> f
> <function f at 0x7ff5066cbb70>
> >>>
>
> However I suppose we're wishing for something along the lines of the 
> python __doc__ string.
>> Date: Tue, 15 Jul 2014 05:19:42 -0400
>> From: "Linda Alvord"<[email protected]>
>> To:<[email protected]>
>> Subject: Re: [Jprogramming] Design goals readability and write
>>     ability?
>> Message-ID: <000001cfa00d$e9c27cd0$bd477670$@net>
>> Content-Type: text/plain; charset=utf-8
>>
>> What if we never needed NuVoc because each verb would tell you it's 
>> definition is if you happened to ask?
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>

----------------------------------------------------------------------
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