From: Marin David Condic <condicma@bogon.pwfl.com>
Subject: Re: Modular type. What is it and why?
Date: 1999/04/06
Date: 1999-04-06T00:00:00+00:00 [thread overview]
Message-ID: <370A4B3A.5EDB3B37@pwfl.com> (raw)
In-Reply-To: 7ede2p$pd1$1@its.hooked.net
Mike Silva wrote:
> Now with Ada I'll be able to write (assuming 'index' is the appropriate
> modular type):
>
> case ( key ) is
> when ARROW_DOWN =>
> index := index + 1;
> when ARROW_UP =>
> index := index - 1;
> end case;
>
> Now -that's- what I call progress!
>
My C is pretty rusty - not having done anything serious in it in at
least 10 years - but wasn't there some kind of type/operation that
allowed for wraparound semantics? I know one of the major early bitches
about Ada(83) was that it didn't allow for unsigned integers, logical
ops on integers & wraparound math - all things considered critical for
embedded programming. (At least at that point in time) If C doesn't
support some or all of these things, then how could it be so "popular"
with the embedded crowd?
I remember enough C to recall that you did have logical operations on
integers and shift/rotate operations on integers as well. Maybe (if my
Parts-heimers would clear up a little so I could remember) the
wraparound semantics were always implemented using logical ops? Not
nearly as pretty as The Ada Way, but it would get you there...
MDC
--
Marin David Condic
Real Time & Embedded Systems, Propulsion Systems Analysis
United Technologies, Pratt & Whitney, Large Military Engines
M/S 731-95, P.O.B. 109600, West Palm Beach, FL, 33410-9600
***To reply, remove "bogon" from the domain name.***
next prev parent reply other threads:[~1999-04-06 0:00 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-04-05 0:00 Modular type. What is it and why? Staffan Dittmer
1999-04-05 0:00 ` Marin David Condic
1999-04-05 0:00 ` David C. Hoos, Sr.
1999-04-06 0:00 ` Mike Silva
1999-04-06 0:00 ` Ole-Hjalmar Kristensen
1999-04-06 0:00 ` Marin David Condic [this message]
1999-04-06 0:00 ` Mike Silva
1999-04-06 0:00 ` bglbv
1999-04-07 0:00 ` Ole-Hjalmar Kristensen
1999-04-07 0:00 ` Mike Silva
1999-04-07 0:00 ` Stephen Leake
1999-04-08 0:00 ` Ole-Hjalmar Kristensen
1999-04-06 0:00 ` Mike Silva
1999-04-07 0:00 ` Robert Dewar
1999-04-07 0:00 ` Bret
1999-04-11 0:00 ` Florian Weimer
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox