From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: renaming Interfaces.Java.Ada_To_Java_String to the + operator
Date: 1998/01/13
Date: 1998-01-13T00:00:00+00:00 [thread overview]
Message-ID: <dewar.884741174@merv> (raw)
In-Reply-To: 34bba5a1.224459@SantaClara01.news.InterNex.Net
Tom Moran said
<<What does
+"abc"&"xyz"
mean, and, more importantly, how many people know without having to
look it up?
>>
Presumably in the
context you intend the "+" to be a unary conversion operator. This
conversion operator would then apply to "abc", since & is an adding
operator. Now I would not expect everyone to know the relative
precedence of these operators (I am too close to the compiler in
this regard, I even know what the value of -5/3 is, careful that's
a trick question :-)
So if you had to write this, I would think a responsible programmer
would write:
(+"abc") & "xyz"
to emphasize the meaning, although perhaps one might decide that the
normal spacing around binary operators is enough (such spacing is
a standard part of the GNAT lexical conventions, spaces for binary
operators, but not for unary operators)
+"abc" & "xyz"
However, in real practice this is a somewhat unlikely piece of program
code in any case. Why? Because normally one would create a set of
coherent abstractions in which there was an & operator that did the
conversion automatically.
It is only when a term appears on its own that the use of "+" is
really necessary.
next prev parent reply other threads:[~1998-01-13 0:00 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-01-11 0:00 renaming Interfaces.Java.Ada_To_Java_String to the + operator Terry J. Westley
1998-01-10 0:00 ` Robert Dewar
1998-01-10 0:00 ` Matthew Heaney
1998-01-13 0:00 ` Tom Moran
1998-01-13 0:00 ` Stephen Leake
1998-01-13 0:00 ` Stephen Leake
1998-01-13 0:00 ` Nick Roberts
1998-01-13 0:00 ` Robert Dewar [this message]
[not found] ` <En3Cxz.7HD@world.std.com>
1998-01-20 0:00 ` Robert Dewar
1998-01-21 0:00 ` Stephen Leake
1998-01-22 0:00 ` Robert Dewar
1998-01-22 0:00 ` Anonymous
[not found] ` <dewar.885498969@merv>
1998-01-23 0:00 ` Geert Bosch
1998-01-23 0:00 ` Tom Moran
1998-01-23 0:00 ` Anonymous
1998-01-24 0:00 ` Tucker Taft
1998-01-11 0:00 ` Chris Morgan
1998-01-11 0:00 ` Robert Dewar
1998-01-11 0:00 ` Chris Morgan
1998-01-11 0:00 ` Robert Dewar
1998-01-11 0:00 ` Chris Morgan
1998-01-11 0:00 ` Robert Dewar
1998-01-11 0:00 ` Nick Roberts
1998-01-11 0:00 ` Brian Rogoff
1998-01-13 0:00 ` Terry J. Westley
1998-01-14 0:00 ` Robert Dewar
1998-01-15 0:00 ` Nick Roberts
1998-01-15 0:00 ` Robert Dewar
1998-01-16 0:00 ` Michael F Brenner
1998-01-16 0:00 ` Nick Roberts
1998-01-16 0:00 ` Robert Dewar
1998-01-17 0:00 ` miniscences Nick Roberts
1998-01-17 0:00 ` miniscences Robert Dewar
1998-01-19 0:00 ` renaming Interfaces.Java.Ada_To_Java_String to the + operator Anonymous
1998-01-25 0:00 ` Matthew Heaney
1998-01-16 0:00 ` Robert Dewar
1998-01-11 0:00 ` Robert Dewar
1998-01-14 0:00 ` Anonymous
1998-01-14 0:00 ` Robert Dewar
1998-01-12 0:00 ` Tucker Taft
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox