On Dec 21, 2007 3:30 PM, Dan Bron <[EMAIL PROTECTED]> wrote:
> and Roger responds (B):
> > So, instead of writing (f + g + h + v), you'd write
> > (f + (g + (h + v F:) F:) F:) . I fail to see why the
> > latter is better.
Keeping in mind that this is an academic discussion,
I do not think that this quoted example is quite right.
If fork is implemented as an adverb which produces
an adverb which produces an adverb which produces
an ambivalent verb, I believe no parenthesis are needed.
In other words, instead of writing
(f +g +h + v)
you would be able to write
f + g + h + v F:F:F:
For example:
serialV=:1 :0
lin=.3!:1]5!:1<'u'
'((3!:2]',(5!:5<'lin'),')5!:0)'
)
F=:1 :0
1 :('Z1=:1 :((''(u y)'',(u serialV),''(',(u serialV),'
y)'');'':'';''(x u y)'',(u serialV),''(x ',(u serialV),' y)'')')
)
0:,1:,2:,3:F F F ''
0 1 2 3
*:, -:, %:,: +: F F F i.4
0 1 4 9
0 0.5 1 1.5
0 1 1.41421 1.73205
0 2 4 6
Note that this rather simplistic implementation does not automatically
promote nouns to constant verbs, but that could be added if anyone
thought this approach was worthwhile.
Note also that (5!:5<'name') almost works for this application, but 5!:5
currently produces script representation, and not linear representation.
(These are equivalent when the result does not contain line feed
characters.) serialV seems to be the easiest workaround for this issue.
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm