Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!udel!haven!ni.umd.edu!uc780.umd.edu!cs450a03 From: cs450a03@uc780.umd.edu Newsgroups: comp.lang.apl Subject: RE: J questions Message-ID: <2APR91.18555001@uc780.umd.edu> Date: 2 Apr 91 18:55:50 GMT References: Sender: usenet@ni.umd.edu (USENET News System) Organization: The University of Maryland University College Lines: 34 Nntp-Posting-Host: uc780.umd.edu Ethan Weg writes: >1) Let us define a conjunction say t=.2 : ' x. y.'. > Suppose I do +/ t 1 2. The answer is 3. Now suppose a=.2 2 $1 2 3 4. > I want t to operate on the cells of rank 1 of a. I do I use the rank > conjunction to obtain the sum of the rows of a? I want to use t. I presume you meant "How do I use the rank conjunction..." Note that t is not a verb, and the result of t is not a verb in this case. Still, you could try +/"1 t a >2) Is there a way to use J in a filter like cat file|J|awk|J...? Well, you can set yourself up a profile and make it read from standard input and write to standard output. I don't think J has developed far enough yet that I'd want to set things up this way. (Yet) >3) Quite generally can one imagine J acting as a shell? The flexibility and syntax would be nice, eh? I think, however, that a lot of the elegance of J results because data objects are fairly static. The efficiency is way to low to do character by character stuff, and adding a "character stream" "type" to J would be essentially a complete re-write. I suppose step one in this direction would be an efficient implementation of J. (Which probably would mean bypassing C and working in assembler -- which is painful because it's hard to port). But just because it's impractical doesn't mean it isn't worth thought.... Raul