in reply to Re^4: "strong typing" is potentially ambiguous
in thread (Completely OT) - Hero(i)n programming language on Slashdot

A type is a set of values ...

I'm glad you brought this up; it gives me a chance to take the flame war in a different direction. ;-)

Under some ped^Wsemantic systems at least, what you've given, above, is a definition of "class", whereas "type" is defined in terms of behavior, not representation. If two objects can "do the same things", then they're the same type. (Usually this means having the same defined behavioral interfaces, irrespective of actual implementation. Sometimes the definition is made more strict: to "do the same thing", the objects must have idential implementations.) Of course, OO language vendors (who shall not be named, *cough*), prefer to use the terms "type" and "class" interchangeably, it seems.

Stand by for updates as I'm forced to recant...

  • Comment on Re^5: "strong typing" is potentially ambiguous

Replies are listed 'Best First'.
Re^6: "strong typing" is potentially ambiguous
by dragonchild (Archbishop) on Dec 15, 2004 at 16:40 UTC
    *blinks* That's really funny, and shows how out of practice I am with formal definitions. I was trying to get at the "quacks-like-a-duck" definition for types. *ponders*

    Maybe this is better: A type T is the set of values for which any operation in a given set of operations O is closed over.

    I noticed on Lambda that some were complaining about defining types in terms of sets. I'm trying to figure out how you define types without sets ...

    As for the term "class" ... isn't a class a coder-defined aggregation of data and coder-defined behaviors? So, in some sense, it would be a coder-defined type, so long as the behaviors were closed over the class ... ?

    Being right, does not endow the right to be rude; politeness costs nothing.
    Being unknowing, is not the same as being stupid.
    Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
    Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.