You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to be able to pass parameters by name on function calls.
This may not be very useful for Java methods, who don't support optional parameters, but for "virtual" functions, it can be very useful.
For example, the uri:Class.method() functions in Renarde, for obtaining a URI from a method name, would benefit greatly from named parameters. Consider the following JAX-RS method:
The "Java-like" syntax for invoking that method would be: {uri:Class.endpoint(id, null, null), given that form parameters and headers don't participate in URI, so we could even shorten it to {uri:Class.endpoint(id)} but that forces us to declare all parameters that participate in URI to the start of the method signature.
(forgetting a minute we can't call new in Qute). But this is not nice. We could also come back to the idea of moving every parameter that participates in URI up and call {uri:Class.endpoint(id, true)} but this not very obvious.
Perhaps the most intuitive way to solve this would be to support named parameters:
{uri:Class.endpoint(id: id, nice: true)}
// or
{uri:Class.endpoint(id=id, nice=true)}
Implementation ideas
No response
The text was updated successfully, but these errors were encountered:
Description
I'd like to be able to pass parameters by name on function calls.
This may not be very useful for Java methods, who don't support optional parameters, but for "virtual" functions, it can be very useful.
For example, the
uri:Class.method()
functions in Renarde, for obtaining a URI from a method name, would benefit greatly from named parameters. Consider the following JAX-RS method:The "Java-like" syntax for invoking that method would be:
{uri:Class.endpoint(id, null, null)
, given that form parameters and headers don't participate in URI, so we could even shorten it to{uri:Class.endpoint(id)}
but that forces us to declare all parameters that participate in URI to the start of the method signature.Now consider this declaration form:
With an optional query param in the container. One way of passing it could be:
(forgetting a minute we can't call
new
in Qute). But this is not nice. We could also come back to the idea of moving every parameter that participates in URI up and call{uri:Class.endpoint(id, true)}
but this not very obvious.Perhaps the most intuitive way to solve this would be to support named parameters:
Implementation ideas
No response
The text was updated successfully, but these errors were encountered: