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

 
 

bug #39194: ROPE assumes lower=1

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

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project AdministratorIn charge of this item.
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>
Project 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)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    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.3