[Jprogramming] Re: Function-level programming
Raul Miller
rauldmiller at gmail.com
Thu Mar 1 07:37:52 HKT 2007
Earlier today, I wrote:
> To avoid having to come up with some new (and currently unknown)
> rules for Dictionary II.E you would need to transform pgr from having
> verb grammar with [. and ]. as placeholders to having conjunction
> grammar. In other words, your example would wind up looking something
> like:
>
> pgr=: (HdLt [. ] ]. TlLt) Conjunction
>
> where Conjunction might be some foreign or even some explicit
> (though neither is currently possible because [. and ]. are
> currently spelling errors), or (vague chance) something like :]
Here's an explicit model of how Conjunction might be implemented.
As [. and ]. are currently spelling errors, I'm using u and v in their
place:
substUV=: 0&({::)@[`(1&({::)@[)`]@.((;:'u v') i. <@])L:_ 0
Conjunction=:1 :0
pat=.'(',(5!:5<'u'),')`'''''
2 :('((u`v) substUV ',pat,')`:6')
)
stk =: ((] ,: u)Conjunction)''
pgr =: (HdLt u ] v TlLt)Conjunction
+/stk
] ,: +/
+/ pgr (-/)
HdLt +/ ] -/ TlLt
That said: while the above works just fine interactively, I
get value errors on u and v when I try to use this approach
in scripts. I don't know why that happens.
Then again, since this is mostly just a model, I'm not sure if
that matters.
--
Raul
More information about the Programming
mailing list