Pascal, It seems to me that your three examples at the end are really are
the starting point for J users.
5 , v2c 2 1 (, v2c) 3 + 4
5 6 5 7
5 , 2 1 3 + 4
5 6 5 7
5 (, v2c) 2 1 (, v2c) 3 + 4
9 6 5 7
(5 , 2 1 , 3) +4
9 6 5 7
5 , v2c 2 1 (, v2c) 3 + 4
5 6 5 7
5 , 2 1 3 + 4
5 6 5 7
To get the three results, understanding that functions are "read" from right
to left, will allow you to build the desired results.
What you are doing is the end of the story. So what you need now are
examples of situations where your functions are either useful or illustrate
a solution to a problem that would otherwise be difficult.
I have found that mastering the simplest aspects of the language -
especially parentheses - needs time and practice.
I'm sure that your functions will be useful to many in this audience, but
the trick is to "sell" them to everyone.
Linda
s Jasmin' via Programming
Sent: Saturday, August 02, 2014 12:35 AM
To: Programming Tforum
Subject: [Jprogramming] parsing abuse, verb to conjunction
this adverb returns a conjunction which is designed to turn any dyadic verb
into a conjunction purely for parsing convenience that a conjunction can
sometimes provide.
lrA =: 1 : '5!:5 < ''u'''
v2c =: 1 : ' 2 : (''m '' , u lrA , '' n'')'
2 1 (, v2c) 3 + 4
6 5 7
appendC =. , v2c
appendC
2 : 'm , n'
2 1 appendC 3 + 4
6 5 7
if you don't put parens around the adverb and its verb argument, then it
treats the full y as the n argument to the resulting conjunction which is
usually not what you want since that is what the original verb would do.
But including one of the conjunction arguments inside the parens, turns it
into an adverb which may provide useful parsing patterns.
5 , v2c 2 1 (, v2c) 3 + 4
5 6 5 7
5 , (2 1 3 + 4)
5 6 5 7
5 (, v2c 2 1) (, v2c) 3 + 4
9 6 5 7
5 (, v2c) 2 1 (, v2c) 3 + 4
9 6 5 7
(5 , 2 1 , 3) +4
9 6 5 7
5 (, v2c) 3 (2 1 , v2c) + 4
6 5 9 7
4 + 2 1 &, 5,3
6 5 9 7
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm