Re: Compiler Error CS0702



Enum and delegate could indeed be useful. (In particular, I'd like to
write a generic version of Enum.Parse to avoid the casts.)

Yes, and I can only guess that support of them was left out because they
don't buy as much as class and struct do. But I see no reason why they
_can't_ be supported by an implementation. So I see no reason for the spec to
disallow them.

If, when generics were first added to the language, the spec had said that
they _are_ to be supported then they _would_ be supported. The argument that
the spec says they _aren't_ because the current implementation doesn't
support them is backward. A _language_ exists separate from any particular
_implementation_.


We can use enums as type parameters, I see no reason not to be allowed to
constrain to them. It's not as if they weren't allowed in generics at all.

I'm looking for a _conceptual_ reason why they aren't, not an
implementation-based reason and so far have seen none.

If one regards _only_ the language, not considering .net, the CLR, CTS etc.;
is there some reason why enum and delegate should _not_ be supported as
constraints?

.



Relevant Pages

  • Re: Definition of outdated...
    ... There are often a reference to a programming language to be ... user) economical reasons that is the reason for them. ... I also hate hypes and you can call me as Delphi fan ... no multiplatform support ...
    (borland.public.delphi.non-technical)
  • Re: Using Delphi 2006 to target .NET 2.0
    ... .NET 2.0 provides the ability to use generics in the ... the only thing missing is the compiler support for a language to ... it is not just a language ... other non-trivial feature in .NET languages. ...
    (borland.public.delphi.non-technical)
  • Re: VB.NET Discussion
    ... That reason is that it is now far ... >>> more likely that your VB6 code will become broken by updates to ... >>> new language you move it to means that you can't just wait until it is ... have continued some level of support for the old language because of the ...
    (microsoft.public.vb.general.discussion)
  • Re: How do I return a return-code from main?
    ... but not the reason why. ... support is built into the language. ... that might want to terminate the program is the same one that started the ...
    (comp.lang.java.help)
  • Re: How do I return a return-code from main?
    ... but not the reason why. ... support is built into the language. ... that might want to terminate the program is the same one that started the ...
    (comp.lang.java.programmer)

Loading