Support Indexed Macro Args
Community Note
Please vote by adding a 👍 reaction to the issue to help us prioritize. If you are interested to work on this issue, please leave a comment.
Feature Spec
I want to use indexed args in wingc macros
/**
* Adds or updates an entry in a Map object with a specified key and a value.
* @macro $self$[$args[0]$]=$args[1]$
*/
public set(key: string, value: T1): void {
key;
value;
throw new Error("Macro");
}
Use Cases
This is currently achievable by doing a inline function with macros like so:
/**
* @macro ((obj, args) => { obj[args[0]] = args[1]; })($self$, [$args$])
**/
Implementation Notes
No response
Component
No response
This is a good idea, though I feel like brackets might makes the macro syntax seem more expression-based or smart than it really is? Not sure...
I wonder if we should try and collect more use cases before making the macro language too complex, given it's possible that macros could become part of the language formally at some point. I feel like they deserve some care given that they're an explicit leak into our JS target code
Hi,
This issue hasn't seen activity in 60 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. Feel free to re-open this issue when there's an update or relevant information to be added. Thanks!
Hi,
This issue hasn't seen activity in 90 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. Feel free to re-open this issue when there's an update or relevant information to be added. Thanks!