Re: Compiler Error CS0702
- From: "Peter Duniho" <NpOeStPeAdM@xxxxxxxxxxxxxxxx>
- Date: Fri, 18 Apr 2008 13:26:46 -0700
On Fri, 18 Apr 2008 13:06:05 -0700, PIEBALD <PIEBALD@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
So, if you are designing a _new_ language, to write software for some
_not-yet-existent_ platform, and it includes enums and generics, you would
_not_ allow enum as a constraint for a generic? Why? That's what I want to
know.
I'm not a language designer, so knowing what I would do is sort of pointless. I don't have the kind of knowledge and experience that would allow me to provide a reliable answer to that question. Unless you're an experienced language designer, I doubt you do either, for what it's worth.
Also, your question is too vague. It doesn't provide any other specifics about the language that might constrain this particular area of the design. In particular, the current state of C# appears to me to be a consequence of wanting to support both reference types and value types, along with wanting to support enums as value types. Change either of those design goals, and what's possible and/or desirable in generics changes as well.
Personally, I feel that both of those goals are important. Much more important than the goal of supporting a special class like System.Enum as a constraint in a generic. The utility of the former goals is as broad as the utility of the latter is not.
As for why one would not support System.Enum as a constraint for a generic given those stated goals, please read the message I already posted, as it already describes my thinking on the matter. There's no need to repeat myself.
Pete
.
- Follow-Ups:
- Re: Compiler Error CS0702
- From: PIEBALD
- Re: Compiler Error CS0702
- References:
- Compiler Error CS0702
- From: PIEBALD
- Re: Compiler Error CS0702
- From: Peter Duniho
- Re: Compiler Error CS0702
- From: Peter Duniho
- Re: Compiler Error CS0702
- From: PIEBALD
- Re: Compiler Error CS0702
- From: Peter Duniho
- Re: Compiler Error CS0702
- From: PIEBALD
- Re: Compiler Error CS0702
- From: Jon Skeet [C# MVP]
- Re: Compiler Error CS0702
- From: PIEBALD
- Re: Compiler Error CS0702
- From: Peter Duniho
- Re: Compiler Error CS0702
- From: PIEBALD
- Compiler Error CS0702
- Prev by Date: Re: Compiler Error CS0702
- Next by Date: problem with client activated object's lease time
- Previous by thread: Re: Compiler Error CS0702
- Next by thread: Re: Compiler Error CS0702
- Index(es):
Relevant Pages
|