Loading ...
Sorry, an error occurred while loading the content.

[eiffel-nice-library] Re: ARRAY '2000

Expand Messages
  • Ulrich Windl
    On 28 Feb 00, at 19:16, Durchholz, Joachim wrote: [...] ... Replace `i -th enry, if in index interval, by `v . So if I specify an index outside the index
    Message 1 of 8 , Feb 28, 2000
    • 0 Attachment
      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.

      [...]
      > > resize:
      > > 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. IOW you may lose

      OOPS, I might have mixed it with reindex...

      > items if the array retains its size but moves to another index range.
      > A slightly better wording might be "Retain items..." instead of "Do not lose
      > items...".
      >

      [...]
      > > valid_bounds:
      > > 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?

      [...]

      Regards,
      Ulrich
    • Durchholz, Joachim
      ... No. The wording says what happens if i is in the index interval. It does not specify what happens if i is outside, but looking at the precondition
      Message 2 of 8 , Mar 1, 2000
      • 0 Attachment
        > From: Ulrich Windl [mailto:Ulrich.Windl@...-regensburg.de]
        >
        > 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.

        No. The wording says what happens if 'i' is in the index interval. It does
        not specify what happens if 'i' is outside, but looking at the precondition
        reveals that it's not allowed anyway.

        > > > resize:
        > > > 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...

        Well, reindex is very different (and not in the proposal I think - we
        consciously omitted a few features because they weren't considered useful
        enough).

        > > > valid_bounds:
        > > > 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_index' is important because it's used in preconditions.
        '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".)

        Regards,
        Joachim
        --
        This is not an official statement from my employer or from NICE.
      Your message has been successfully submitted and would be delivered to recipients shortly.