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
Actually the parameter handling has the following restrictions:
keyword arguments are translated to a destructuring object assignment at the end of the positional parameters list. This is the same for the keywords parameters accumulator which is translated to an object. This means that passing keywords on call is not positionally indifferent: all the preceding positional parameters have to be specified before the keywords.
Because of the previous point, the positional parameters accumulator, the keywords parameters or the keywords accumulator cannot be specified ad the same time. The fact that the keywords container is also positional and the fact that at call time is impossible to distinguish between expected keywords and the others that should be put inside the keyword accumulator forbids that.
The solution to this can be found in something that is "rendered" at translation time only or something that is half rendered and half a runtime feature, but with additional computation cost.
The former may be the rendering a proxy function for every declared function that uses a pre-determined calling convention and the addition of this proxy to the main function object. For each call, render a diverted path that checks for the existence of the proxy and calls it.
The latter would be to render the addition of python-oriented signature metadata to each function and render (maybe optionally) calls to be proxied via an utility function that takes care of handling the parameters according to the exported function signature.
The first solution may clutter the sources with each proxy definition but may be quicker in terms of speed compared to the second solution which may produce cleaner sources but relies on more runtime calculations.
Any other idea?
The text was updated successfully, but these errors were encountered:
Actually the parameter handling has the following restrictions:
keyword arguments are translated to a destructuring object assignment at the end of the positional parameters list. This is the same for the keywords parameters accumulator which is translated to an object. This means that passing keywords on call is not positionally indifferent: all the preceding positional parameters have to be specified before the keywords.
Because of the previous point, the positional parameters accumulator, the keywords parameters or the keywords accumulator cannot be specified ad the same time. The fact that the keywords container is also positional and the fact that at call time is impossible to distinguish between expected keywords and the others that should be put inside the keyword accumulator forbids that.
The solution to this can be found in something that is "rendered" at translation time only or something that is half rendered and half a runtime feature, but with additional computation cost.
The former may be the rendering a proxy function for every declared function that uses a pre-determined calling convention and the addition of this proxy to the main function object. For each call, render a diverted path that checks for the existence of the proxy and calls it.
The latter would be to render the addition of python-oriented signature metadata to each function and render (maybe optionally) calls to be proxied via an utility function that takes care of handling the parameters according to the exported function signature.
The first solution may clutter the sources with each proxy definition but may be quicker in terms of speed compared to the second solution which may produce cleaner sources but relies on more runtime calculations.
Any other idea?
The text was updated successfully, but these errors were encountered: