bugLiberty Eiffel - Bugs: bug #39194, ROPE assumes lower=1

 
 

bug #39194: ROPE assumes lower=1

Submitter:  Cyril Adrian <cadrian>
Submitted:  Fri 07 Jun 2013 11:51:06 AM UTC
   
 
Category:  Kernel libraries Severity:  3 - Normal
Priority:  * 5 - Normal Status:  Invalid
Assigned to:  Tybor Open/Closed:  Closed
Release:  adler Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 30 Jul 2013 12:38:04 PM UTC, comment #1: 

This bug is actually invalid since ABSTRACT_STRING clearly states that it is a "Character STRINGs indexed from `1' to `count'." and therefore defines "lower: INTEGER is 1".

My humble opinion is that code dealing with strings of text shall never makes any assumption of the actual value of lower.
In fact C strings set lower to 0 a manifest legacy optimization as comparing to zero has always been a fast operation even on CPU from seventies.

Removing the invariant "lower = 1" would allow to implement fixed substring of fixed strings using only a reference and two offsets.

Do you think it is worth at least a little debate?

Paolo Redaelli <Tybor>
Group administrator
Fri 07 Jun 2013 11:51:06 AM UTC, original submission:  

https://github.com/LibertyEiffel/Liberty/issues/20

While it is customary that ABSTRACT_STRING.lower is 1 it is wiser to remove this assumption even on ROPE.

In fact we may want to change this invariant in future.

Cyril Adrian <cadrian>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by Tybor (Posted a comment)
  • -email is unavailable- added by cadrian (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-07-30 Tybor StatusNone Invalid
        Open/ClosedOpen Closed
        ReleaseNone adler

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code