We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
It would be nice if we could write something like this:
add_class_tostring = (target, name) -> target.<tostring> = () => "<class '#{name}'>" target #[add_class_tostring] class FooBar -- ... print(FooBar) --> <class 'FooBar'>
It would be equivalent to this:
FooBar = add_class_tostring(class FooBar -- ... "FooBar")
The name parameter would be statically determined from the declaration. This has the advantage that a statement like
#[wrap_func] local x = () -> print("...")
would also have access to the name (x in this case). That would be equal to:
x
local x = wrap_func((() -> print("...")), "x")
Of course, name would have to be nil if the statement doesn't have a name (like a name-less class).
name
nil
Additionally, macros should also be invocable as attributes:
macro example = (target, name) -> target #[$example] class FooBar -- ...
That would be equivalent to:
FooBar = $example(class FooBar -- ... FooBar)
Note that, unlike a regular macro, the output of an attribute macro would not need to be wrapped in a do-expression.
do
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
It would be nice if we could write something like this:
It would be equivalent to this:
The name parameter would be statically determined from the declaration. This has the advantage that a statement like
would also have access to the name (
x
in this case). That would be equal to:Of course,
name
would have to benil
if the statement doesn't have a name (like a name-less class).Additionally, macros should also be invocable as attributes:
That would be equivalent to:
Note that, unlike a regular macro, the output of an attribute macro would not need to be wrapped in a
do
-expression.The text was updated successfully, but these errors were encountered: