-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add "Argument ref" parameters #64
Comments
Although I've just had a look at adding this myself and it's not going to be simple as Or maybe there's some crazy ref-foo I don't know about. (maybe Edit: Ok ignore that last suggestion, getting a ref to the underlying |
The usage side should be fairly easy, I would expect there's a reasonably easy way to get whether a parameter has the And yeah, it looks like |
I'll add support for ref params as a first pass, with nothing special as far as retrieving the values, as I ideally want to support as many use cases as possible, even if there isn't much real benefit. |
I've create #66 to add basic ref parameters support, I'm going to look at ways to try and convert to the specialized |
I'm not sure if my opening post made sense, what I was suggesting was to use a If the source generator worked by taking an object, then it would make sense to bind a property to an argument, then the setter would delegate to the underlying |
Aaaah, got you, yeah, that would be quite nice and ergonomic for mutating parameters, I was trying to think of ways this could be doable. now the libraries split into code and generator, I might add a type for convenience that allows something like this that gets special handling by the generator. |
From looking at the example in the README, it looks like a nice feature would be to have an attribute that could only be used with a
ref
parameter.So the example would become this:
The code gen would ref return the value from the
context.Arguments
array behind the scenes, reusing the existingIndexOf
functionality.The text was updated successfully, but these errors were encountered: