Newsgroups: comp.lang.apl
Path: watmath!watserv1!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!qt.cs.utexas.edu!yale.edu!jvnc.net!phage!wchang
From: wchang@cshl.org (Bill Chang)
Subject: Re: APL2 question
Message-ID: <1992Mar16.201028.29567@cshl.org>
Summary: APL transliteration
Sender: news@cshl.org (NO MAIL)
Organization: Cold Spring Harbor Laboratory
References: <9203152248.AA24898@bottom.magnus.acs.ohio-state.edu> <728@kepler1.rentec.com>
Date: Mon, 16 Mar 92 20:10:28 GMT
Lines: 56

In article <728@kepler1.rentec.com> andrew@rentec.com (Andrew Mullhaupt) writes:
>
>	V <- (1 2 3 7) (2 4 5 6 1) (7 1 2)
>
>Now you just apply the magic formula:
>
>	without reduce negative 1 drop 2 ravel reduce V
>
>which gives you the answer. This is one of my own idioms, and I like to use
>it to prove that APLers can't really _read_ good APL. (Though they claim
>that they can, I have a bunch of these little stumpers which I got to
>test on some of the better APL programmers during my stint at Morgan Stanley.)
>C would run an order of magnitude faster than the APL2.)

I'll admit this confounds me... and my APL2 :-)  Is something lost in
translation?  

Back when APL2 came out, one complaint I heard was that APL syntax errors 
invariably parsed under APL2; almost anything one writes, executes :-)  
Then a paper came out (Jim Brown) which tried to justify APL2 syntax but 
made compression / into an operator to be confused with reduction.  

In any case, I would love to see more of these little stumpers :-)

>P.S. It's good to see an APL question in com.lang.apl again. I think J is a 
>different language and by now it probably deserves its own group.

I agree...  However, if that happened there won't be enough APL to sustain
comp.lang.apl, so APL stuff will just be posted to comp.lang.j :-)  I'm
surprised there hasn't been a movement to _rename_ this group.

In the spirit of encouraging more APL discussion, I'll repost "APL slash bang"
to compete with J on this ASCII medium (slash / is rho; bang ! is iota).  
The lucid code Mike Kent just posted would appear as follows, in APL/!:

      ~& boolean =. CHARACTERISTIC indices; @IO
  [1] boolean=.(1+>./.indices)/.@IO=.0
  [2] boolean[indices]=.1

      ~& z =. left INTERSECT right; maxlen
  [1] maxlen=.(/left)>./right
  [2] z=.(maxlen|left)^.maxlen|right

      ~& integers =. MEMBERS boolean; @IO
  [1] @IO=.0
  [2] integers=.boolean/.!/boolean

      MEMBERS|INTERSECT/.CHARACTERISTIC"V
or
      MEMBERS^./.[!1]~c. CHARACTERISTIC"V

(In order of appearance: 
 ~& del   =. left-arrow   @ quad   >. max   /. reduce or compress   / rho
 | take or first          ^. and   ! iota   " each   ~c. disclose)

-- Bill Chang (wchang@cshl.org)
