Re: Something that really annoys me in Delphi ...
From: Bruce Roberts (ber_at_bounceitattcanada.xnet)
Date: 01/08/04
- Next message: Tony J Hopkinson: "Re: Something that really annoys me in Delphi ..."
- Previous message: Rob Kennedy: "Re: Something that really annoys me in Delphi ..."
- In reply to: Maarten Wiltink: "Re: Something that really annoys me in Delphi ..."
- Next in thread: Dr John Stockton: "Re: Something that really annoys me in Delphi ..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 7 Jan 2004 18:03:38 -0500
"Maarten Wiltink" <maarten@kittensandcats.net> wrote in message
news:3ffc7f34$0$325$e4fe514c@news.xs4all.nl...
> There is a philosophical question here. Is it permissible to call
> Succ on a value that has no successor, if one never thereafter evaluates
> the return value? If a type rolls over in a forest where there's no-one
> to see it, does it make a crash?
Yes, but there is no one there to hear it scream.
ISTM that there should be two functions Succ and SuccWrap, and of course
Pred and PredWrap. Succ and Pred should raise exceptions when used on
boundary values. The Wrap versions should wrap to the first/last value.
Should be able to work with any ordinal type.
Now that I think about it perhaps there needs to be just Succ and Pred each
with an additional parameter that defines its boundary behavior.
tIncrementBehavior = (ibUndefined, ibWrap, ibException, ibPassedValue);
function Succ (value; BoundaryBehavior : tIncrementBehavior =
ibUndefined);
function Pred (value; BoundaryBehavior : tIncrementBehavior =
ibUndefined);
Of course this does as some interesting work for the compiler authors since,
IIRC, Succ and Pred are not true functions.
- Next message: Tony J Hopkinson: "Re: Something that really annoys me in Delphi ..."
- Previous message: Rob Kennedy: "Re: Something that really annoys me in Delphi ..."
- In reply to: Maarten Wiltink: "Re: Something that really annoys me in Delphi ..."
- Next in thread: Dr John Stockton: "Re: Something that really annoys me in Delphi ..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]