-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
method to apply a function upon a wildcard type #687
Comments
Actually since you can nest calls inside anonymous functions, I guess you only need |
Uh, why not just support the simple form of capture that I proposed? It has nice error messages and everything. |
@RossTate where is that proposal again? The main reason I'm not proposing to support real wildcard capture is that in full generality the runtime side of it with reified generics looks like it will get pretty hairy. Not impossible, but not easy either. |
It's pretty simple. You do wildcard capture but you ignore implicit constraints (i.e. you only constrain the captured type variable with the explicit given by the So you get wildcard capture, but you never have to have |
We could alleviate most of the pain involved in our lack of support for wildcard capture by supplying a couple of functions that accept a wildcarded object or objects, and a generic function, and apply the function to the object or objects. Something like this:
Of course, these functions can't be implemented in Ceylon, they have to be
native
.Also notice that they're pretty painful to use, since you will always need to explicitly specify all the type arguments.
The text was updated successfully, but these errors were encountered: