[Jprogramming] Stumped on verbs that print...
Henry Rich
HenryHRich at nc.rr.com
Thu Oct 5 20:49:05 HKT 2006
Use
f 'x'
. For a similar tool, see ...\system\packages\misc\fndisplay.ijs .
Henry Rich
> -----Original Message-----
> From: programming-bounces at jsoftware.com
> [mailto:programming-bounces at jsoftware.com] On Behalf Of
> Yuvaraj Athur Raghuvir
> Sent: Thursday, October 05, 2006 2:45 AM
> To: Programming forum
> Subject: [Jprogramming] Stumped on verbs that print...
>
> 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
> --T-┐
> │f│x│
> L-+--
> -- 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