Re:Red Hat's top secret Java Killer/Successor: The Ceylon Pr...
by fleitz on Wednesday April 13, 2011 @03:11AM
(#2441120)
I suggest the ' operator as in
I have no idea why you even have to specify that a method is generic shouldn't it be generic by inference?
[ Parent
| on HN ]
Re:Red Hat's top secret Java Killer/Successor: The Ceylon Pr...
by beagle3 on Wednesday April 13, 2011 @03:20AM
(#2441142)
If quotes are used for grouping characters (as they are in C, Java, C#, Python etc.) then this is just as bad as using <>. How can you tell if it is a character literal or a type?
Re:Red Hat's top secret Java Killer/Successor: The Ceylon Pr...
by fleitz on Wednesday April 13, 2011 @03:38AM
(#2441180)
I have no idea but F# does exactly that.
I'm guessing that it uses a context sensitive grammar that doesn't allow you to use string literals for variable names.
Re:Red Hat's top secret Java Killer/Successor: The Ceylon Pr...
by kiiski on Wednesday April 13, 2011 @04:56AM
(#2441315)
Maybe, but the problem was that "all lexing/parsing/syntax highlighting/analysis of the language is much harder because of this horrible choice". Using quotes doesn't really fix that.
Re:Red Hat's top secret Java Killer/Successor: The Ceylon Pr...
by munificent on Wednesday April 13, 2011 @01:59PM
(#2443392)
The problem is that you often need to decorate a generic parameter with additional information (like its type constraints or variance). If the type parameter doesn't have a singular place where it's "declared", there's no convenience place to do that. In your example, how would you specify that T must implement Summable?