Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!apple!agate!helios.ee.lbl.gov!ucsd!ucsdhub!hp-sdd!ncr-sd!ncrcae!hubcap!billwolf%hazel.cs.clemson.edu From: billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu (William Thomas Wolfe, 2847 ) Newsgroups: comp.lang.c Subject: Re: C strongly typed? Message-ID: <8314@hubcap.clemson.edu> Date: 11 Mar 90 17:49:31 GMT References: <4417@hydra.Helsinki.FI> Sender: news@hubcap.clemson.edu Reply-To: billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu Lines: 27 From grano@cs.Helsinki.FI (Kari Gran|): > P.S. Oh, and I think I forgot 'new's from my previous posting. In fact > I'm not so sure about that.. maybe someone could correct this? > >> declare >> type apple is integer; -- could read: type Apple is new Integer; >> type orange is integer; -- could read: type Orange is new Integer; >> a : apple; >> o : orange; >> begin a:= o; end; Actually, it would not matter. By LRM 3.3.1(8), "Two type definitions always define two distinct types, even if they are textually identical." The "new" mechanism will generally be used when we want to put more constraints on the new type than we had specified for the base type: type Weekday is new Day range Monday..Friday; This creates the type Weekday, which is distinct from (and incompatible with) the type Day. If we wanted to make them distinct but compatible: subtype Weekday is Day range Monday..Friday; Bill Wolfe, wtwolfe@hubcap.clemson.edu