On Friday 15 November 2013 09:33:32 Michael Schnell wrote:
> On 11/14/2013 09:28 PM, Sieghard wrote:
> > It might not be very neccessary if these types aren't compatible among
> > each other. Range checking has to be done only on coercion then, i.e.
> > when assigning a value cast from a - any - different type.
>
> I understand that Martin is (IMHO) correctly assuming that range
> restricted numerical types (only) make sense if you do realtime range
> checking on them.
>
Compile time range checks already have a benefit.
"
type
 subty = 0 to 5;
var
 sub1: subty;
 i1: int32;
...
 sub1:= 123; <<<--- compiler error
 sub1:= i1;  <<<--- compiler error
 sub1:= subty(i1); <<<--- runtime range check
"

Martin

------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to