Years ago I got interested in quaternions and wrote a tool to calculate
quaternions in J. The tools on the web were just too hard to use. It wasn't
just a quaternion calculator, it would read a J sentence and using the J
parser allow me to extend J numbers into quaternions and replace J
primitives with names which would handle quaternions. For example in the ijx
window. Normal J sentences except the numbers are quaternions:
]q=.2i3j4 1+/2k1 1i2j3k4 5
4i3j4k1 3i5j7k4 7i3j4
3k1 2i2j3k4 6
+:q
8i6j8k2 6i10j14k8 14i6j8
6k2 4i4j6k8 12
All I really cared about was handling primitive verbs and nouns.
Later to really learn J better I wrote a tool called MN for mnemonics
(improperly named) to translate primitives into the appropriate name for the
primitive, allowing for parity and position in a sentence. In this case I
was interested in handling adverbs and conjunctions and other things in a J
sentence properly. A much more involved problem. The parsing started getting
out of hand. Still haven't finished it satisfactorily. So I have been
thinking of trying to use trace so I could get inside the parsing better.
On Sat, Feb 12, 2011 at 5:30 PM, Dan Bron <[email protected]> wrote:
> Don wrote:
> > Look at the verb "trace" defined in
> > J7 '~addons/general/misc/trace.ijs'.
>
> Thanks. I thought about this too, but figured if I could just write an
> appropriate x&;: and uni2Puny (which I'd have to do anyway), and applied ".
> , that would be enough. That is, I wouldn't have to write my own parser, or
> understand or adapt the one in trace.
>
> > I should have gone to the trouble to understand
> > trace as it would have done a much better job.
>
> But I'm interested in why you concluded this. Can you give me a little
> background on the project and why you think trace would have done a better
> job?
>
> > handling copulas
>
> I can see how writing my own parser would allow me to support sentences
> like:
>
> ← =: =:
>
> ... but I'm not sure that's worth it to me. I don't prefer it, but I think
> I'm ok with forcing my users to write copulae the standard way.
>
> -Dan
>
>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm