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

Re: [eiffel-nice-library] Call to vote: STRING 'replace_substring'

Expand Messages
  • Roger Browne
    ... Yes. This is how the 30 OCTOBER 2000 version should look: replace_substring(s: STRING; start_index, end_index: INTEGER) -- Replace the substring from
    Message 1 of 5 , Oct 31 9:15 AM
      James McKim wrote:
      > It looks like both postconditions survived :-). Maybe post a clarification?

      Arno Wagner wrote:
      > The second one is correct...
      > ... It seems Roger just forgot to delete the wrong one.

      Yes. This is how the "30 OCTOBER 2000" version should look:

      replace_substring(s: STRING; start_index, end_index: INTEGER)
      -- Replace the substring from start_pos to end_pos, inclusive,
      -- with `s'.
      require
      string_not_void: s /= Void
      valid_start_index: 1 <= start_index
      valid_end_index: end_index <= count
      meaningful_interval: start_index <= end_index + 1
      ensure
      replaced: is_equal(old (substring(1, start_index - 1) +
      s +
      substring(end_index + 1, count)))

      Of the duplicate postconditions, I have removed the first one, which was
      incorrect.

      Please proceed with voting, on the assumption that the motion refers to
      the corrected version above.

      Regards,
      Roger
      --
      Roger Browne - roger@... - Everything Eiffel
      19 Eden Park Lancaster LA1 4SJ UK - Phone +44 1524 32428
    Your message has been successfully submitted and would be delivered to recipients shortly.