Case-logic/enumerated types
Blake
blake at kingdomrpg.com
Mon Nov 1 19:42:46 UTC 2004
On Sun, 31 Oct 2004 13:47:06 -0400, <lex at cc.gatech.edu> wrote:
> I meant in Pascal or C. In these languages, there is a single
> declaration that lists all the possibilities. To add more possibilities
> you have to modify that declaration.
True. But necessary? (Maybe.<s>)
> These languages don't have
> subclasses, so it is not a big deal. I wonder what C++ does for this,
> though? Can a C++ subclass add items to an enumerated type its
> superclass uses? I bet not -- figuring out what it would mean is a
> headache!
No, in both C++ and Object Pascal, the enumerated types are unchanged from
their ancestral non-object forms.
> Chuck is a project to help people browse Smalltalk code. Its browser
> lets you point to a variable and say "what is your type", among other
> things. The type system of Chuck includes types like "#foo or #bar or
> #baz", ie lists of symbols. And that's my answer to your second
> question: I think that lists of symbols would be the Squeak-equivalent
> of an enumerated type.
>
> Chuck is on SqueakMap, and has this home page:
'k. I'll have to check Chuck out.
More information about the Squeak-dev
mailing list
|