[eiffel-nice-library] Re: ARRAY '2000
> From: Ulrich Windl [mailto:Ulrich.Windl@...-regensburg.de]No. The wording says what happens if 'i' is in the index interval. It does
> On 28 Feb 00, at 19:16, Durchholz, Joachim wrote:
> > > put:
> > > IMHO the comment "..., if in index interval..." is misleading,
> > > because one might think such an index is allowed. The
> > > preconditions says something else.
> > I'm not sure what you mean here.
> "Replace `i'-th enry, if in index interval, by `v'". So if I specify
> an index outside the "index interval" no value is put there?
> THAT IS NOT TRUE: The call is not allowed. The original wording might
> imply that the value is allowed.
not specify what happens if 'i' is outside, but looking at the precondition
reveals that it's not allowed anyway.
> > > resize:Well, reindex is very different (and not in the proposal I think - we
> > > I'd change the comment at "Do not lose any item..." and use
> > > "Change index of any item..." instead.
> > No, items at an index stay at that index after resizing.
> OOPS, I might have mixed it with reindex...
consciously omitted a few features because they weren't considered useful
> > > valid_bounds:'valid_index' is important because it's used in preconditions.
> > > If we have `valid_index', why not have a `valid_bounds' as
> > > well? IMHO the users would also appreciate it.
> > Where would they use it? 'valid_bounds (min, max)' would
> > just be a shorthand for
> > 'min + 1 <= max and valid_index (min) and valid_index (max)'
> > which is easy enough to write down (a bit cumbersome but we
> > can't put all cumbersome constructions into ARRAY, that would
> > bloat the class beyond usability).
> Just as for "valid_index". But is it bad just because it's handy?
'valid_bounds' isn't nearly as important: it can be defined in terms of
'valid_index'. (We could define 'valid_index' in terms of 'valid_bounds',
but that's a bit backwards. Besides, the name is not as unmistakable:
'valid_bounds' could mean either "valid bounds for a subarray" or "valid
bounds for an ARRAY in general".)
This is not an official statement from my employer or from NICE.