[Jprogramming] Stumped on verbs that print...
Yuvaraj Athur Raghuvir
yuvaraj.a.r at gmail.com
Thu Oct 5 14:44:56 HKT 2006
In the article [1] John Howland introduces math_pat as
math_pat =: 3 : 0
'''',y.,'('',y.,'')''',LF,':',LF,'''',y.,'('',x.,'','',y.,'')'''
)
Changing this to J6 syntax, I have
math_pat =: 3 : 0
'''',y,'('',y,'')''',LF,':',LF,'''',y,'('',x,'','',y,'')'''
)
math_pat 'f'
'f(',y,')'
:
'f(',x,',',y,')'
With this I defined
f =: (3 : (math_pat 'f')) :. (3 : (math_pat 'f_inv'))
I expected that
f x
f(x)
Instead, after enabling all possible display formats I get
f x
f x
┌─┬─┐
│f│x│
└─┴─┘
┌─ f
─┴─ x
f x
How can I get the desired parenthetic format? I want to study the J
function composition rules using this technique.
~Yuva
[1] http://www.cs.trinity.edu/~jhowland/math-talk/functional/
More information about the Programming
mailing list