Xref: utzoo comp.arch:22004 comp.lang.misc:7390 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.arch,comp.lang.misc Subject: RE: Compilers and efficiency Message-ID: <12APR91.20523461@uc780.umd.edu> Date: 12 Apr 91 20:52:34 GMT References: <27fa3350.6bc2@petunia.CalPoly.EDU> <11APR91.21114644@uc780.umd.edu> <10205@mentor.cc.purdue.edu> Sender: usenet@ni.umd.edu (USENET News System) Organization: The University of Maryland University College Lines: 53 Nntp-Posting-Host: uc780.umd.edu Herman Rubin > Me >| Michael Turner >** >** Guy Harris's example (if I remember correctly) was that no >** language he knew of had semantics for retrieving both the integer >** quotient and the remainder from a floating divide ... >| You mean like >| 0 3.141592654 #: 20 >| 6 1.150444076 >Translate, please. Seeing the results, I still do not have any idea what >the instruction does or how to put the results in a useful place, probably >registers. Well, (x,y) #: z where x, y, and z are all single numbers returns two results. The "number on the right" is the remainder from z divided by y. The "number on the left" is the quotient of that division modulo x. "N modulo 0" is defined to be N. Therefore, (0,y) #: z computes the dividend and remainder of y divided by z. Finally, note that for constants, the notation (x, y) may be abbreviated by just writing the two numbers separated by a space. >The problem with APL and other such wierdos (like 99+% of the >assembler languages) is their highly artificial syntax. Anything you understand is simple. Anything you do not understand is not simple. I suppose I should also point out that in infix notation a function takes arguments on both the right side and the left side. I don't know if it is relevant to describe the details of this mechanism. Also note that #: is a single symbol. >APL does have one feature lacking in at least most other languages; >it attempts to have a reasonably compact notation. But there is no >adequate macro processor available. An adequate macro processor >would include the capability of easily translating APL into other >languages, for example, and even having the translation take into >account types. He he... APL is just now getting around to using ASCII... give it a little time before it translates to every language under the sun. :-) Other than that, it looks like all you are asking for is constant folding. Raul