comp.lang.ada
 help / color / mirror / Atom feed
From: hymie@panix.com (Hyman Rosen)
Subject: Re: Ada vs. C++ (Readability)
Date: 1997/09/09
Date: 1997-09-09T00:00:00+00:00	[thread overview]
Message-ID: <5v4kie$jp1@panix.com> (raw)
In-Reply-To: 341566c7.0@news.uni-ulm.de


In article <341566c7.0@news.uni-ulm.de>,
Joerg Rodemann <rodemann@mathematik.uni-ulm.de> wrote:
>However, looking at some examples I was suddenly struck by frustration:
>There was some code, that obviously could not work!!! At least that's what
>it looked like. Or how would you interpret the lines:
>  ray x, n;
>
>  x = 1.00,  0.40,  -1.00;
>  n = 0.31,  0.20,   0.93;
>
>Surely at first glance whatever type x and n will be, x will be assigned
>the value 1.00, n will be assigned 0.31. The remaining expression is not
>relevant at all from the definition of the colon operator!!!

Well, I would interpret the lines the way they look - assigning a three
element vector to each of the variables. Do you somehow find this to be
unreadable? It looks straightforward to me!

The implementation is cute, of course. You forgot that assignment has
lower precedence than comma. In function syntax, those lines become

	x.operator=(1.00).operator,(0.40).operator,(-1.00);
	n.operator=(0.31).operator,(0.20).operator,(0.93);

The comma operator has been prettily redefined to cause concatenation.




  reply	other threads:[~1997-09-09  0:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-09-09  0:00 Ada vs. C++ (Readability) Joerg Rodemann
1997-09-09  0:00 ` Hyman Rosen [this message]
1997-09-10  0:00   ` Joerg Rodemann
1997-09-11  0:00     ` Hyman Rosen
1997-09-10  0:00   ` Simon Wright
1997-09-11  0:00     ` Robert Dewar
1997-09-11  0:00       ` Hyman Rosen
1997-09-12  0:00         ` Joerg Rodemann
1997-09-15  0:00         ` Richard A. O'Keefe
replies disabled

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