g looks more like forks than f:

 

   f=: 13 :'x(*:@[ + *:@])y'

   g=: 13 :'(*:x)+*:y'

   (4 f 5)-:4 g 5

1

   5!:4 <'f'

        -- *:
  -- @ -+- [ 
  +- +       
--+     -- *:
  L- @ -+- ] 

   5!:4 <'g'

      -- [:
  ----+- *:
  │   L- [ 
--+- +     
  │   -- [:
  L---+- *:
      L- ] 

   

 

Linda

 

 

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Kip Murray
Sent: Friday, December 4, 2015 1:20 AM
To: [email protected]
Subject: Re: [Jprogramming] My first J conjuction

 

And you can use a fork in the definition of a conjunction:

 

    of =: 2 : 'v@[ u v@]'

    4 + of *: 5

41

 

On Thursday, December 3, 2015, Kip Murray < <mailto:[email protected]>
[email protected]> wrote:

 

> A fork is not a conjunction but it shows what you are doing:

> 

> 

>     4 (*:@[ + *:@]) 5

>  41

> 

> 

> On Thursday, December 3, 2015, Lippu Esa <[email protected] 

> <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote:

> 

>> It is 5:17 AM in Finland and I already have two good answers. Thank 

>> you David and Pascal!

>> 

>> It seems that I haven't been using Compose either :) . But at least I 

>> knew that this is the place to be.

>> 

>> Thanks again,

>> 

>> Esa

>> 

>> -----Original Message-----

>> From:  <mailto:[email protected]>
[email protected] [mailto:

>>  <mailto:[email protected]>
[email protected]] On Behalf Of David Lambert

>> Sent: perjantaina 4. joulukuuta 2015 5.14

>> To: programming < <mailto:[email protected]>
[email protected]>

>> Subject: Re: [Jprogramming] My first J conjuction

>> 

>> I expect you'll get many of the same response.  Your conjunction is 

>> fine, however this particular case is so frequent there's a built in 

>> conjunction.  Read "but first",

>>      x f&g y

>> or

>>      x f&:g y

>> the difference being rank.  Add but first square:

>> 

>>        4 +&: *: 5

>> 41

>> 

>> 

>> On 12/03/2015 10:05 PM,
<mailto:[email protected]>
[email protected] wrote:

>> > Date: Fri, 4 Dec 2015 03:05:50 +0000

>> > From: Lippu Esa< <mailto:[email protected]> [email protected]> To:"
<mailto:[email protected]> [email protected]"  

>> > < <mailto:[email protected]> [email protected]>

>> > Subject: [Jprogramming] My first J conjuction

>> > Message-ID: <4C1D3F3685BCAE4699AA47F9961903BA33126CC3@VDOMES02>

>> > Content-Type: text/plain; charset="us-ascii"

>> >

>> > Hello everybody,

>> >

>> > I realized with some shame that I haven't written a single J

>> conjunction - ever. Some adverbs, yes, but they too are newish.

>> >

>> > I have a recurring need for sentences like (f x) g f y where verb f 

>> > is

>> applied to nouns x and y and dyadic verb g is then applied to the two 

>> results.

>> >

>> > and was thinking of something like x f c g y with c being a conjuction.

>> This is what was the result:

>> >

>> > fxgfy=: 2 : 0

>> > :

>> > (v x) u v y

>> > )

>> >

>> > 4 + fxgfy *: 5 NB. very simple example

>> >

>> >     4 + fxgfy *: 5

>> > 41

>> >

>> > Is there a more natural J way to do this? What would be a good name 

>> > for

>> this type of conjunction or operation?

>> >

>> > Esa

>> 

>> ---------------------------------------------------------------------

>> - For information about J forums see 

>>  <http://www.jsoftware.com/forums.htm>
http://www.jsoftware.com/forums.htm

>> ---------------------------------------------------------------------

>> - For information about J forums see 

>>  <http://www.jsoftware.com/forums.htm>
http://www.jsoftware.com/forums.htm

>> 

> 

> 

> --

> Sent from Gmail Mobile

> 

 

 

--

Sent from Gmail Mobile

----------------------------------------------------------------------

For information about J forums see  <http://www.jsoftware.com/forums.htm>
http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to