Path: utzoo!attcan!uunet!cs.utexas.edu!uwm.edu!rpi!crdgw1!ge-dab!puma!andrew.ATL.GE.COM!jnixon From: jnixon@andrew.ATL.GE.COM (John F Nixon) Newsgroups: comp.lang.c Subject: Re: C strongly typed? Message-ID: <220@puma.ge.com> Date: 12 Mar 90 13:27:46 GMT References: <4417@hydra.Helsinki.FI> <8314@hubcap.clemson.edu> Sender: news@puma.ge.com Lines: 27 billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu (William Thomas Wolfe, 2847 ) writes: > 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; What about this? type Weekday is 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; Would this break (ahhhh, I mean cause problems, errrr, well...)? subtype Weekday is new Day range Monday..Friday Wouldn't the programmer tend to get confused (I *think* both are illegal)? Would it not be better to say new type X is Y -- incompatible type declaration type X is Y -- compatible type declaration Gee, this Ada stuff looks mighty confusing; maybe someone should write adadecl ;-) -- ---- jnixon@atl.ge.com ...steinmetz!atl.decnet!jnxion