comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@world.std.com>
Subject: Re: Modular types inside records
Date: 2000/10/24
Date: 2000-10-24T00:00:00+00:00	[thread overview]
Message-ID: <wcc1yx6qpy3.fsf@world.std.com> (raw)
In-Reply-To: 8FD6C49EFPablo@213.25.200.9

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 859 bytes --]

niewiap@widzew.net (Pawe� Niewiadomski) writes:

> I don't think that adding a couple of if statements makes the code more 
> readable.

Or a couple of "mod" operators.

>...  On the contrary:  if someone looks at the record and sees a 
> modular type, he says: OK, so I don't have to worry about constraint 
> errors; I can get down to the important stuff.

When I see a modular type, I say: OK, so I don't have to worry about
constraint errors; I have to worry about wrong answers.  Half :-).

>...  My implementations of the 
> empty and full functions are just one-line-long and add and remove 
> procedures each take up as much as five lines of code.  Imagine what they 
> would look like if you had to check for constraint errors every time.

I don't understand that -- you don't *check* for C_E, you write the code
so it doesn't cause C_E.

- Bob




  reply	other threads:[~2000-10-24  0:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-21  0:00 Modular types inside records Pawe� Niewiadomski
2000-10-21  0:00 ` Robert Dewar
2000-10-21  0:00   ` Pawe� Niewiadomski
2000-10-21  0:00     ` Jeff Carter
2000-10-21  0:00       ` Pawe� Niewiadomski
2000-10-23  0:00     ` Robert A Duff
2000-10-23  0:00       ` Pawe� Niewiadomski
2000-10-24  0:00         ` Robert A Duff [this message]
2000-10-25  1:50         ` Nick Roberts
2000-10-25  0:00           ` Pawe� Niewiadomski
2000-10-27 22:05         ` Robert Dewar
replies disabled

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