« Return to Thread: Syntax for generic parameter declaration

Re: Syntax for generic parameter declaration

by Ayende Rahien-2 :: Rate this Message:

Reply to Author | View in Thread

How would you handle it when you don't want interface constraint?

On 5/23/07, Cedric Vivier <cedricv@...> wrote:

On 5/23/07, Avish <some.avish@...> wrote:
> How about:
> public class MyGenericClass[of T1, T2]
>     when T1 is struct
>     when T2 is IComparable, callable
>
> This uses existing reserved words, although I'm not sure about using
> "callable" to indicate a default constructor constraint.

I'm not fond of it either.
How about:

when T2 is IComparable()

Maybe not very "legal-looking" but it may be more obvious because of
the similar look with the syntax for instantiating types.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Boo Programming Language" group.
To post to this group, send email to boolang@...
To unsubscribe from this group, send email to boolang-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/boolang
-~----------~----~----~----~------~----~------~--~---

 « Return to Thread: Syntax for generic parameter declaration