Newsgroups: comp.lang.apl
Path: watmath!watserv2.uwaterloo.ca!torn!cs.utexas.edu!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!elroy.jpl.nasa.gov!jato!csi!sam
From: sam@csi.jpl.nasa.gov (Sam Sirlin)
Subject: Re: Selective assignment (was Re: J is NOT APL)
Message-ID: <1993Feb1.200933.16116@csi.jpl.nasa.gov>
Originator: sam@kalessin
Sender: usenet@csi.jpl.nasa.gov (Network Noise Transfer Service)
Nntp-Posting-Host: kalessin
Organization: Jet Propulsion Laboratory, Pasadena, CA
References: <1993Jan26.184600.24394@csi.jpl.nasa.gov> <1993Jan27.094037.13820@csus.edu> <1993Jan27.221845.11152@csi.jpl.nasa.gov> <1993Jan29.233943.5662@csus.edu>
Date: Mon, 1 Feb 1993 20:09:33 GMT
Lines: 45


In article <1993Jan29.233943.5662@csus.edu>, emclean@sfsuvax1.sfsu.edu (Emmett McLean) writes:
|>    y0 selectiveAssign i1;x0
|> index error (selectiveAssign)
|> 
|>    See.

Yes, I do see the point of error indication here. I just found it a
bit hard to see what was going on! 

I wrote:
|> >   I'd really like to build something that I could use without amend:
|> >   x i thing a
|> >   but haven't found a way to do this. Does amend then violate the
|> >   gander principle?
|>    
|>    Gees. Isn't 
|>    (x;i) selectiveAssign~ a
|>    close enough? -:)

Well it's not bad, and it's true it probably doesn't cost unreasonable
computer time (though it does cost an extra copy of the data in
memory), but my question is: can a user build a "verb" that takes 2
left noun arguments and one right noun argument and returns a noun,
the way ammend does? I know ammend is technically an adverb, but
whatever it is, can a user define something that acts the same way?
How does a user defined adverb take a noun for it's usual verb left
argument? 

|>    selectiveAssign could easily be made part of the verb I've been
|>    working on (I've posted a preliminary version) for general assignment
|>    into a noun.  Thus one verb could handle row assignment, column 
|>    assignment, and selective assignment.

This general verb does sound like a very useful thing, especially for
those of us comming from APL. I think it proves my point that
assignment is missing in J. It seems strange to need to write these
things in a dialect of APL, which started out with (IMHO) a powerful
and very useful, if inconsistent assignment and reassignment
"feature". Doesn't stop me from using (and generally liking) J though!

-- 
Sam Sirlin
Jet Propulsion Laboratory         sam@kalessin.jpl.nasa.gov

