-
Notifications
You must be signed in to change notification settings - Fork 2
Syntax for implicit conversion of output parameters, constrained parameters and adapting parameters #43
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
Comments
And ideally it should be possible to write This would also declare the local variable |
Here the declared value |
The foregoing may be relatively easy to implement, except maybe for the requirement expressed in the previous section. To keep things simple, let's drop this requirement. The main problem seems to be: what kind of variable declaration should this be equivalent with?
|
This test is a bit wrong:
Within |
This does not yet use the syntax
|
"matches" is available from the implicit script. Can you please write a new
|
That should be like:
|
In C# 7.0 such parameters will be called "out variables". We may learn from those:
|
As for the syntax: I think these should just be syntactic sugar.
The preprocessor currently packs occurrences of
?a
,?a ?if(...)
and??a
inActualOutputParameter
,ActualConstrainedParameter
andActualAdaptingParameter
.This is done when the expression is inside a script parameter list, not yet as terms in script expressions awaiting an implicit conversion. Well, I am not sure; I think that is not supported yet.
So with an
implicit script key(??c: Int)
we should be allowed to write:and with implicit conversions:
The text was updated successfully, but these errors were encountered: