comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: generic function and overloading
Date: Fri, 19 Oct 2007 09:59:43 -0400
Date: 2007-10-19T09:59:43-04:00	[thread overview]
Message-ID: <wcck5pj19yo.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: m27ilj7kca.fsf@mac.com

Simon Wright <simon.j.wright@mac.com> writes:

> Robert A Duff <bobduff@shell01.TheWorld.com> writes:
>> Nitpick: I'd use a case statement rather than an if statement, here.
>
> Is this for symmetry or in case some later Ada standard allows a third
> option? (I could buy the symmetry/clarity argument, good point).

Symmetry/clarity.  I like case statements, because they list out all the
cases, and the compiler checks that you didn't forget any (so long as
you don't say "others"), so the reader of the code sees exactly those
cases.  And it's order independent.  With an if statement, you have
to compute in your head when "else" means.  No big deal in this case,
of course -- it's a bigger deal when there's a chain of "elsif"s.

- Bob



  reply	other threads:[~2007-10-19 13:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-18  7:28 generic function and overloading eliben
2007-10-18  8:18 ` Jean-Pierre Rosen
2007-10-18  9:31 ` Dmitry A. Kazakov
2007-10-18  9:33   ` Dmitry A. Kazakov
2007-10-18 10:32 ` Georg Bauhaus
2007-10-18 11:07 ` Stephen Leake
2007-10-18 11:30 ` Stefan Lucks
2007-10-18 15:58 ` Robert A Duff
2007-10-18 20:20   ` Simon Wright
2007-10-18 21:23     ` Robert A Duff
2007-10-19  5:19       ` Simon Wright
2007-10-19 13:59         ` Robert A Duff [this message]
2007-10-18 18:58 ` Dr. Adrian Wrigley
2007-10-18 22:30   ` Adam Beneschan
replies disabled

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