comp.lang.ada
 help / color / mirror / Atom feed
From: milod@netcom.com (John DiCamillo)
Subject: Re: Ada self-referential operators
Date: Wed, 8 Feb 1995 20:13:18 GMT
Date: 1995-02-08T20:13:18+00:00	[thread overview]
Message-ID: <milodD3p6u6.7sD@netcom.com> (raw)
In-Reply-To: ROGOFF.95Feb8090424@sccm.Stanford.EDU

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?



  reply	other threads:[~1995-02-08 20:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-02-01  9:34 Ada self-referential operators R.A.L Williams
     [not found] ` <3hnoe6$1aoi@info4.rus.uni-stuttgart.de>
     [not found] ` <3grqrf$jkd@gnat.cs.nyu.edu>
1995-02-06 20:51   ` Kenneth Almquist
1995-02-08  2:06     ` John Volan
1995-02-08  6:45       ` Jay Martin
1995-02-08  9:04       ` Brian Rogoff
1995-02-08 20:13         ` John DiCamillo [this message]
1995-02-09 23:52           ` David Weller
1995-02-10  6:48         ` pang
1995-02-10 16:15           ` Robert I. Eachus
1995-02-09 17:30       ` Norman H. Cohen
1995-02-11 13:56         ` Robert Dewar
     [not found]   ` <3id9qi$a7m@usenet.srv.cis.pitt.edu>
1995-02-25 13:28     ` Larry Kilgallen, LJK Software
1995-03-08 23:26     ` Val Kartchner
  -- strict thread matches above, loose matches on Subject: below --
1995-02-10 17:07 R.A.L Williams
1995-02-11  5:34 ` Keith Thompson
     [not found] <3id0oo$e64@gnat.cs.nyu.edu>
1995-02-23 17:45 ` Brian Hanson
1995-03-01 18:41   ` Thomas G. Coles (1W0)
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox