C strongly typed?
John F Nixon
jnixon at andrew.ATL.GE.COM
Mon Mar 12 23:27:46 AEST 1990
billwolf%hazel.cs.clemson.edu at 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 at atl.ge.com ...steinmetz!atl.decnet!jnxion
More information about the Comp.lang.c
mailing list