([: f g) and f@:g are already equivalent in functionality, at least in contexts which are independent of how they are phrased.
It might have been nice to have a third way of expressing the same concept. This would make teaching people about J easier for those not interested in the language and would have the added benefit of reducing the expressive power of the language. But perhaps writing textbooks on interesting subjects could be a more useful investment of time. For example, I would really like to see a textbook on finite element analysis which centered around using J to develop the requisite techniques. I would also like to see one written on antenna theory. I remember in college doing some interesting work with x-ray analysis of crystals using APL, and that was with computers far less capable than what we have nowadays, and APL was far less capable than J is nowadays. So it seems like it really ought to be straightforward to write decent treatments of engineering topics - topics related to making things - in J. There's also a need for other things, of course, but some things seem just so obvious that they are aching for attention. Thanks, -- Raul On Wed, Apr 30, 2014 at 4:09 PM, 'Pascal Jasmin' via Programming < [email protected]> wrote: > With the hindsight from 17 years of usage, I would > define 2-verb trains differently, viz. > (f g) y <-> f g y > x (f g) y <-> f (x g y) > > a bit surprising to me: > > I agree with monad, but existing dyad hook is useful, as per yesterday's > discussion. That proposal would make dyad equivalent to ([: f g) and > almost equivalent to f@:g. > > The existing (ambivalent) hook could still be expressed by the fork ([ f > g@:]), > but a shorter analogue to f@:g where f is the ambivalent verb rather than > g seems useful. > > > ----- Original Message ----- > From: Raul Miller <[email protected]> > To: Programming forum <[email protected]> > Cc: > Sent: Wednesday, April 30, 2014 2:36:02 PM > Subject: Re: [Jprogramming] Simple tacit verbs problem > > Also worth keeping in mind might be: > > http://www.jsoftware.com/pipermail/general/2006-January/026271.html > > "With the hindsight from 17 years of usage, I would define 2-verb trains > differently ... " > > but note also > > http://www.jsoftware.com/pipermail/general/2006-January/026274.html > > "There is no intention to replace the current hook. Its use seems too > embedded and too numerous and a change like that would be too disruptive." > > Generally speaking: good documentation for code is often more important to > produce than the code itself, but businesses and educational institutions > both focus on the wrong metrics, thus undercutting their short and long > term success. J is actually incredibly good here, but of course it still > has significant room for improvement. > > And, we get rough edges like this hook issue, which tend to create problems > and bafflement but where "fixing it" would make things worse (require far > more explanation about why all this great code fails). > > It's something of a dilemma. > > Thanks, > > -- > Raul > > > > On Wed, Apr 30, 2014 at 12:12 PM, robert therriault > <[email protected]>wrote: > > > Hi Jon, > > > > Like so many things in J, an added character usually does make a > > difference. That is the cost of using less to say more. :) > > > > In this case, I think that you have a pretty good handle on func1, so I > > will focus on what func2 is doing. > > > > func2 is a hook which means that func2 5 is acting like 5((3&+) (2&-)) 5 > > because hooks (u v) y are the same as y( u v) y which is the same as y u > ( > > v y) > > > > In your case func2 5 is like 5 (3&+) ((2&-) 5) same as 5 (3&+) _3 . > This > > is where things change up a bit because you are asking (3&+) to be > executed > > on _3 a total of 5 times. In other words add 3 to _3 five times and you > > have 15+_3 which is 12 > > > > I see Ian has already given some good links for further reading. It does > > seem confusing at first, but it is consistent and does let you do some > > remarkable things when you get a feel for it. > > > > Cheers, bob > > > > On Apr 30, 2014, at 8:42 AM, Jon Hough <[email protected]> wrote: > > > > > I can't understand why > > > func1 =. 3&+ @: (2&-) > > > func2 =. (3&+) (2&-) > > > > > > give different results as mondaic verbs. > > > func1 5 gives 0, which is what I would expect. > > > func2 5 gives 12, which I can't understand. > > > I would like to know what the difference is between func1 and func2. It > > is my understanding that for monadic verbs @: is optional, so doesn't add > > anything to the meaning of the whole verb. > > > Regards. > > > ---------------------------------------------------------------------- > > > 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 > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
