Newsgroups: comp.lang.apl Path: utzoo!utgpu!cunews!csi.uottawa.ca!news From: cbbrowne@csi.uottawa.ca (Christopher Browne (055908)) Subject: Some General Questions about J Message-ID: <1991Feb23.234505.5960@csi.uottawa.ca> Keywords: n Sender: news@csi.uottawa.ca Nntp-Posting-Host: prgc Organization: CSI Dept., University of Ottawa Date: Sat, 23 Feb 91 23:45:05 GMT I'm in the process of trying to assimilate some sort of understanding of the J language. It looks like it has distinct advantages over APL, notably in that it doesn't use "funny characters." That makes it: a) Easier to port to multiple machines i.e. - it's MUCH LESS hardware dependent. One APL solution is to have a standard "character set generator" for each machine - but you still have to put together SOMETHING that's massively machine dependent when you use classical APL. b) Nicer to use with foreign file systems. It uses "standard ASCII" (and EBCDIC support wouldn't be too hard to add...) so that files will be far easier to move between different machines & versions of the language. I don't know how "classical APL" put together workspaces, but I'm pretty sure that the ONLY sensible way to edit it was by using APL (or some customized version of XEDIT...). This adds Yet Another Improvement: c) You can use ANY editor to edit programs/data. Old APL workspaces were ugly in MANY ways... Being able to load vars/ functions from files is a NICE improvement. I can use Emacs, you can use Brief, someone else can use WordPerfect (ick!)... Others may use vi... BUT --- There seem to be a few downsides. Related to one of them, I have a public question... a) Doesn't use the "funny characters" That special character set WAS good in that it was easy to tell the various operations apart. Now, instead of looking like strange-character gibberish, the code looks like punctuation gibberish... It'll take some work with the system to be able to figure out the operator set, especially since MANY have characters in common. This is a lose-lose situation. There are both advantages and disadvantages to using either a) Special APL characters or b) Combinations of standard punctuation characters. I think that the benefits of moving to ASCII outweigh the costs, but there IS certainly a cost... b) Documentation at FTP archives This isn't a language issue - just a distribution issue. All I could find on watserv1 was a document entitled "J Implementation Status," showing the various verbs, adverbs, conjunctions, pronouns, copulae, and conjunctions, with (in most cases) not much explanation of what they're about. T'would be nice to have some sort of brief documenting describing: I) What is J? How did APL work lead to J? II) What are the major differences? III)What are the operators? What do they do? (e.g. - giving a little more than just the operators' names.) I've been able to figure out many of my confusions by looking at the sundry tutorial files, but it would be nice to have some sort of overview of the system. I realize that there's a $24 J Reference Manual available, but I'm a poor grad. student who can't really afford every manual that comes available... If I start using J really extensively, then maybe... c) Matrix Referencing (the "" operation) This shouldn't be TOO hard... In original APL, one could grab part of a matrix by doing something like the following: (I'll add a little J in to substitute for those operators that are not in ASCII...) EXPENDITURES=. 2 3 6 $ 161 161 161 164 164 164 9 3 11 6 4 4 10 17 22 9 11 20 130 132 184 197 163 0 1 7 9 10 5 6 21 24 8 11 17 161 EXPENDITURES 161 161 161 164 164 164 9 3 11 6 4 4 10 17 22 9 11 20 130 132 184 197 163 0 1 7 9 10 5 6 21 24 8 11 17 161 I'd then like to add things up with respect to the second index. I'd use the operation: +/[2]EXPENDITURES getting: 180 181 194 179 179 188 152 163 201 218 185 167 In J, it's something annoying like +/ {Ugliesomitted{MoreUglies{EXPENDITURES Question 1) What should those two sets of uglies be? Question 2) There must be some general J idiom for doing this sort of thing. What might it be? Question 3) Why was this operation changed? I can see that the new way is far more explicit (and may be able to do things the old way couldn't). The square braces aren't used for anything in J now - they could have been used for the old operation. Why not? (I'm sure there are good reasons for these things. I'd just like to know why...) -- Christopher Browne cbbrowne@csi.uofottawa.ca University of Ottawa Master of System Science Program