Call to vote: specification of STRING 'insert_string'
- I've now closed off the current eGroups poll (about the name of this
feature). As you will see, there was a strong (but not universal)
preference for 'insert_string'. As I said previously, changes of vote can
be accepted at any time until ELKS2001 is finalized.
I'm now setting up a vote to refine the specification of 'insert_string',
for the following version:
13 SEPTEMBER 2000 VERSION:
insert_string (s: STRING; i: INTEGER)
-- Insert 's' at index 'i', shifting characters between ranks
-- 'i' and 'count' rightwards.
string_not_void: s /= Void
valid_insertion_index: 1 <= i and i <= count + 1
inserted: is_equal(old substring (1, i - 1)
+ old clone (s) + old substring (i, count))
This is basically the McKim SEP 99 version, with the following two
- 'string_not_void' instead of 'string_exists' as the precondition tag
- 'STRING' instead of "like current" as the type of 's'.
Voting is open to all NICE members. The eGroups poll will run for three
days. If you cannot vote within that time, or have difficulty with the
eGroups mechanism, feel free to post your vote to this list.
Here is the version that this would replace (being a renamed ELKS95
insert_string (s: like Current; i: INTEGER)
-- Add 's' to the left of position 'i'.
string_exists: s /= Void;
index_small_enough: i <= count;
index_large_enough: i > 0
new_count: count = old count + s.count
After this vote closes, I will invite further discussion about "like
current", and if three or more people want a vote we'll hold one.
Roger Browne - roger@... - Everything Eiffel
19 Eden Park Lancaster LA1 4SJ UK - Phone +44 1524 32428