Menu

#3 Declaration of Datatypes as Integer Ranges

(not used)
closed
nobody
None
1
2013-10-08
2013-04-17
No

Hi Simon.

How do I declare a datatype as an integer range. I'm thinking that this used to be achieved in Rational Rose by entering e.g. { integer = lower 2 | upper 14 } in the class documentation pane.

Discussion

  • Alex Proudfoot

    Alex Proudfoot - 2013-04-17

    Aha. I see. In this version, I write a package spec and import from it.

     
  • Simon Wright

    Simon Wright - 2013-04-18

    I was trying to think of a neat way to support this. Current favourite is to add a stereotype, maybe «constraint», on the lines of «access», with associated tags {constrained-type}, {lower} and {upper}.

     
  • Simon Wright

    Simon Wright - 2013-04-20

    Release 20130420 implements the idea above (except that {constrains} replaces {constrained-type}).
    NB, this implements the constraint by subtyping; the old CF way, {integer=lower 1|upper 5}, translated to

    type T is range 1 .. 5;
    
     
  • Simon Wright

    Simon Wright - 2013-04-20
    • status: open --> pending
     
  • Alex Proudfoot

    Alex Proudfoot - 2013-04-24

    I get ...

    subtype T is Integer range 1 .. 5;
    

    I think this works as intended.

     

    Last edit: Alex Proudfoot 2013-04-24
  • Simon Wright

    Simon Wright - 2013-10-08
    • status: pending --> closed
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.