Spec#, nullables and more

"Jérôme M. Berger" jeberger at free.fr
Sat Nov 6 12:02:08 PDT 2010


Walter Bright wrote:
> bearophile wrote:
>>> Suppose, for example, you are appending the numbers 1..5 to the
>>> array, and somehow appended a 17. Many moons later, something crashes
>>> because the 17 was out of range.
>>
>> This bug doesn't happen in Ada (and Delphi), because you define a
>> ranged integer type like this:
>> subtype Small is Integer range 1 .. 5;
> 
> Since you're the second to misunderstand me in the same way, I obviously
> wasn't very clear at all. Allow me to restate:
> 
> Suppose, for example, you are appending prime numbers to the array, and
> somehow appended a 25. Many moons later, something crashes because the
> 25 was
> not prime.

	I thought D was supposed to be a pragmatic language? All this means
is that we need a compromise between what would be ideal (being able
to represent arbitrary conditions and have them statically enforced
at compile time) and what can be realistically achieved. Your
argument seems to be: "since there are cases which we won't be able
to handle, let's not do anything at all, not even the cases which we
could handle".

		Jerome
-- 
mailto:jeberger at free.fr
http://jeberger.free.fr
Jabber: jeberger at jabber.fr

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20101106/f20b8184/attachment.pgp>


More information about the Digitalmars-d mailing list