Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!usc!sdd.hp.com!think.com!news!mjab From: mjab@nanna.think.com (Michael J. A. Berry) Newsgroups: comp.lang.apl Subject: what makes the atomic rep so special? Message-ID: Date: 28 Feb 91 21:50:15 GMT Sender: news@Think.COM Distribution: comp.lang.apl Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 81 I have been tearing my hair trying to debug a gnu emacs j-interaction mode so I can post it here. An important feature of this emacs mode is that when you say meta-control-g (remember where del used to live?), it pops up two little windows containing, respectively the monadic and dyadic definitions of a j verb. You than edit these to your heart's content in a familiar environment where each line in the buffer represents a separate J statement. You are free to leave either buffer empty if your verb only has a monadic (or dyadic) definition. It's all very nice except that it doesn't work. My problem is that when I get emacs to construct what look to me like perfectly good atomic representations, the fix adverb (5!:0) barfs on them. Does anyone know what secret thing makes an atomic rep different from what I am building? I can make my editor work by giving up on fix and having emacs send apl an input string with lots of doubled quotes and a :: somewhere in the middle, but out of pure intellectual curiosity, I still want to know how to build my own atomic representations. Here's what I'm doing that doesn't work: ================= from J 2.9 session on Sun 4 ======================== mg z=. 2 z $: y. dg x. * y. $dg 1 7 mg build_ar dg +------------------------------+ |+--+-------------------------+| ||::|+-----------+-----------+|| || ||+-+-------+|+-+-------+||| || |||0|z=. 2 |||0|x. * y.|||| || ||| |z $: y.||+-+-------+||| || ||+-+-------+| ||| || |+-----------+-----------+|| |+--+-------------------------+| +------------------------------+ (mg build_ar dg) FIX domain error real =. ar 'goo' real +------------------------------+ |+--+-------------------------+| ||::|+-----------+-----------+|| || ||+-+-------+|+-+-------+||| || |||0|z=. 2 |||0|x. * y.|||| || ||| |z $: y.||+-+-------+||| || ||+-+-------+| ||| || |+-----------+-----------+|| |+--+-------------------------+| +------------------------------+ goo2 =. real FIX goo2 4 8 Here is the function I am using to make the fake atomic reps: build_ar +---------+--+--------------------------------+ |x. $: i.0|::|< '::'; < (< (,0);x.) ,< (,0);y.| +---------+--+--------------------------------+ Thanks for any help, Michael -- ============================================== Michael J. A. Berry Internet: mjab@think.com uucp: {harvard, uunet}!think!mjab telephone: (617) 234-2056 FAX: (617) 234-4444 ==============================================