;[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, October 24, 2003 4:10 AM
Subject: Re: [ADVANCED-DOTNET] C# generics constraints syntax
For the WHY - propably to facilitate the AddNew () behavior that most
lists define.
I can see a new (string, int) to be useable at times, but frnakl
] On Behalf Of Eric Gunnerson
> Sent: Saturday, 25 October 2003 3:44 a.m.
> To: [EMAIL PROTECTED]
> Subject: Re: [ADVANCED-DOTNET] C# generics constraints syntax
>
> I should probably note at this point that "where" is a contextual
> keyword - the same as "get&quo
ell
Sent: Thursday, October 23, 2003 3:26 PM
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] C# generics constraints syntax
I think convoluting the syntax is a much worse choice than adding a new
keyword. Adding ontop of that the chances of error ( which is incorrect and is an easy mistake to
ussion of advanced .NET topics.
> [mailto:[EMAIL PROTECTED] On Behalf Of
> Daniel O'Connell
> Sent: Freitag, 24. Oktober 2003 03:02
> To: [EMAIL PROTECTED]
> Subject: Re: [ADVANCED-DOTNET] C# generics constraints syntax
>
> On further research(read the c# 2.0 spe
> public class Dictionary : IEnumerable
> where T : Bar, Bax, new()
> where S : IComparable, new()
> BTW, what does the "new()" do?
It insures the type has a public (parameterless) constructor, so that new
instances of T and S can be created. There is a new C# 2.0 document that
talks about this f
a glaring omission
that only default constructors can be defined, any one have any comments as
to why?
- Original Message -
From: "Thong (Tum) Nguyen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 23, 2003 5:51 PM
Subject: Re: [ADVANCED-DOTNET
PDC!
- Original Message -
From: "Thong (Tum) Nguyen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 23, 2003 5:51 PM
Subject: Re: [ADVANCED-DOTNET] C# generics constraints syntax
> You're probably right. I'm just toying with alterna
uch larger, especially as the
> argument list starts to grow. Imagine 7 or 8 type arguments with
> constraints, unlikely as it may be, with ANY existing syntax...doesn't
> look
> pretty does it?
>
>
> ----- Original Message -
> From: "Thong (Tum) Nguyen" &l
ong (Tum) Nguyen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 23, 2003 4:46 AM
Subject: Re: [ADVANCED-DOTNET] C# generics constraints syntax
> I think something along the lines of
>
> would be a reasonable alternative to the "where"
clause.
October 2003 1:27 p.m.
> To: [EMAIL PROTECTED]
> Subject: Re: [ADVANCED-DOTNET] C# generics constraints syntax
>
> FWIW, the design of the Java language has gone in the other direction; the
> syntax is: Foo. I am not sure how multiple
> constraints are specified (T extends Ba
To: [EMAIL PROTECTED]
> Subject: Re: [ADVANCED-DOTNET] C# generics constraints syntax
>
> Because you can't represent multiple constraints in the one-liner since
> commas are already used to separate KeyType and ValType:
>
> public class Dictionary
> where KeyType: ICo
pics.
[mailto:[EMAIL PROTECTED] On Behalf Of Daniel O'Connell
Sent: Thursday, 23 October 2003 9:05 AM
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] C# generics constraints syntax
I'd say readability first, personally. It'd be alot easier to read
public class Dictionary where Ke
is way. It would be tough to
determine what the second type name is, should it be named ICollection,
IAnotherThing, ValueType, etc?
- Original Message -
From: "Thong (Tum) Nguyen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 22, 2003 5:50
vanced .NET topics. [mailto:ADVANCED-
> [EMAIL PROTECTED] On Behalf Of Thong (Tum) Nguyen
> Sent: Wednesday, October 22, 2003 5:50 PM
> To: [EMAIL PROTECTED]
> Subject: [ADVANCED-DOTNET] C# generics constraints syntax
>
> Hey folks,
>
> Can anyone think of a reason why the con
Hey folks,
Can anyone think of a reason why the constraints syntax is this:
public class Dictionary where KeyType : IComparable
rather than this:
public class Dictionary
?
The former adds an additional (unreserved?) keyword to the language and
locates two related things apart from each other
15 matches
Mail list logo