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

Call to vote: STRING 'fill/fill_with'

Expand Messages
  • Roger Browne
    You should soon receive a message from eGroups inviting you to vote on the following proposal: Proposal for class STRING: Select the name of the ELKS2001
    Message 1 of 1 , Jul 10 1:10 PM
      You should soon receive a message from eGroups inviting you to vote on
      the following proposal:

      Proposal for class STRING:

      Select the name of the ELKS2001 feature
      corresponding to ELKS1995 'fill':

      Strongly prefer 'fill'
      Prefer 'fill'
      Prefer 'fill_with'
      Strongly prefer 'fill_with'
      Don't mind (happy either way)
      Abstain (not happy either way)

      Voting runs for three days and is open to all NICE members. If you are
      unable to vote during that time, or have problems with the eGroups
      polling system, feel free to send your vote to this list.

      ----

      'fill' and 'fill_with' were the two most popular options in the recent
      eGroups discussion. I have included a copy of the overview posting (from
      13 June) at the end of this email.

      There has been no dissent over the semantics of 'fill[_with]', so the
      specification will look like this:

      fill[_with] (c: CHARACTER)
      -- Replace every character with c.
      ensure
      same_count: old count = count
      filled: occurrences(c) = count

      Regards,
      Roger

      === RE-POSTING OF OVERVIEW FROM 13 JUNE 2000 ===

      [I wrote:]

      I'd like to introduce STRING 'fill' to our discussion now. This is a
      rather tricky feature, with a messy history.

      ELKS 95 says this:

      fill (c: CHARACTER)
      -- Replace every character with c.
      ensure
      -- allblank: For every i in 1..count, item (i) = Blank

      Unfortunately, the postcondition is nonsense. I'm pretty sure that the
      intention of this feature was to replace the characters at positions
      1..count with 'c', without changing 'count'.

      VE and SE support 'fill' with this behaviour, and they both also provide
      'fill_with' as a synonym (although it's marked "obsolete" in VE).

      ISE has a completely different 'fill':

      fill (other: CONTAINER [CHARACTER]
      -- Fill with as many items of other as possible.
      -- The representations of other and current structure
      -- need not be the same.
      -- (from COLLECTION)
      require -- from COLLECTION
      other_not_void: other /= void;
      extendible

      Clearly, this is not the ELKS 95 'fill'. It originates in INDEXABLE, one
      of the ancestors of STRING in ISE EiffelBase.

      HACT has the same 'fill' as ISE, but it is marked obsolete like this:

      obsolete "Use ``fill_from_container'', as ``fill''
      has a different signature in ELKS"

      HACT renames 'fill' as 'fill_from_container' when inheriting from
      INDEXABLE, and therefore provides a 'fill_from_container' in STRING that
      is the same as ISE's 'fill'.

      HACT does not provide a version of ELKS 95 'fill', but it seems clear
      from the "obsolete" clause that they intend to support ELKS 95 'fill' in
      some future release.

      ISE does provide a feature that works like ELKS 95 'fill' - it's called
      'replace_character'. No other vendor supports 'replace_character'.

      So, what is the best way forward from here, assuming as usual that
      interoperability is important? I see several options:

      1. Retain 'fill' in ELKS 2001, and encourage ISE to
      support it.

      2. Change 'fill' to 'replace_character' in ELKS 2001,
      and encourage HACT/VE/SE to support it.

      3. Change 'fill' to 'fill_with' in ELKS 2001, and
      encourage ISE/HACT to support it.

      4. Drop 'fill' from ELKS 2001, and use the new ELKS 2001
      creation feature 'make_filled' when it is desired
      to fill a STRING.

      Here's the ELKS 2001 specification of 'make_filled':

      creation

      make_filled (c: CHARACTER; n: INTEGER)
      -- create string of length 'n' filled with 'c'
      require
      valid_count: n >= 0
      ensure
      count_set: count = n
      filled: occurrences (c) = count

      ...

      === END OF RE-POSTING OF 13 JUNE 2000 OVERVIEW ===
      --
      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.