From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4961da398a273222 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-02-08 12:13:18 PST Newsgroups: comp.lang.ada Path: nntp.gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!gw1.att.com!csn!boulder!agate!howland.reston.ans.net!ix.netcom.com!netcom.com!milod From: milod@netcom.com (John DiCamillo) Subject: Re: Ada self-referential operators Message-ID: Organization: NETCOM On-line Communication Services (408 261-4700 guest) References: <3gnkjb$gso@miranda.gmrc.gecm.com> <3grqrf$jkd@gnat.cs.nyu.edu> Date: Wed, 8 Feb 1995 20:13:18 GMT Date: 1995-02-08T20:13:18+00:00 List-Id: rogoff@sccm.Stanford.EDU (Brian Rogoff) writes: >John G. Volan writes: > I never cease to be amazed (and disgusted) at how enamored some people > in this industry seem to be about using arbitrary sequences of special > characters for just about everything under the sun. Who says it's > *desirable* to load up a language with a lot of cryptic > "mathematicalese"? Doesn't anyone remember how *hard* it was to learn > math, way back in grade school? >In some problem domains it is very useful to have concise operators. >MATLAB, for example, even makes up new "YAFOs" to represent common >matrix manipulations. While I agree that overuse of special operators >could lead to highly unreadable code, tasteful use of such operators >makes reading math, and by extension, mathematical code, easier (IMO). >People could also choose bad names for functions and variables and make >code unreadable that way, yet I've never heard it suggested that we should >program in the untyped lambda calculus! > IMHO, the operators that Ada currently supplies ought to be considered > a grudging concession to the algebraic indoctrination we all suffered > as children. The only reason they are there at all is because they've > been beaten into our heads for so long that it is impossible to escape > them. The last thing they should be viewed as is as a precedent for > yet more operators. Yeah! In fact, let's spell *everything* out! function add taking integer lhs and integer rhs giving integer is begin return lhs plus rhs end function smiley taking nothing giving sarcasm is begin return quote colon dash rightparen quote end smiley smiley smiley No offence John, I know you didn't mean to take it this far! >Eiffel 3 allows one to make up new "binary operator" names, although >without true function overloading this is probably not too complicated. >Any Eiffelists feel that this is bad/good? Also, I am pretty sure that >Axiom, and probably other computer math systems, aloow one to define >new operators. Maybe it's just something that math folks like? At the risk of getting completely off the subject (whatever it was :-) I would add that user-definable infix operators are hardly unheard of in newer languages. Cecil and Self both use the convention (a'la Smalltalk? its been a while) that any function name beginning with a letter uses prefix syntax, while any function beginning with a punctuation character uses binary infix syntax. Standard ML allows for functions to be named with either letter combinations or special character combinations; regardless of name, any function can be specified as prefix or infix (but not both). So no, it's not just something that "math folks" like. And no, I'm not suggesting that Ada would be better if only it had cool overloaded operator syntax like SML. But they really are cool, y'know? -- ciao, milo ================================================================ John DiCamillo Pinin' for the fjords? milod@netcom.com What kind of talk is that?