[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: NEW & extending redefinition
- To: ooc-list@informatik.uni-kl.de
- Subject: Re: NEW & extending redefinition
- From: Guy Laden <guy@math.tau.ac.il>
- Date: Wed, 16 Apr 1997 19:19:21 +0300 (GMT+0300)
- In-Reply-To: <9704161156.aa23695@bordeaux.informatik.uni-kl.de> from "acken@informatik.uni-kl.de" at Apr 16, 97 11:56:41 am
> > From: Guy Laden <guy@math.tau.ac.il>
> > Date: Tue, 15 Apr 1997 01:31:57 +0300 (GMT+0300)
> >
> > > NEW (v, 0)
> > ...
>
> > Oberon/F triggers a COMPILE-TIME check for the above, and a 'value
> > out-of-range' runtime error when the '0' was replaced with a
> > variable containing 0. To be honest I dont much like the above
> > behaviour. I remember a few times I had to add the the checks for
> > zero anyway.
>
> You are saying that you _had_ applications that wanted to allocate a
> zero length array in a perfectly sane context? Correct?
Yes.
The limitation was needlessly cluttering my class invariants and
various procedure preconditions.
However perhaps a compile-time warning for the case where things can
be statically determined would be useful.
Guy