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
@harrah said:
"Who knows what someone might be doing with a Unit." is a reasonable comment, so here's the justification...
As much as possible, I should be able to replace a normal method with a macro without affecting clients of that method.
The specific situation where this might come up is when a user redefines a previously side-effecting task to do nothing, such as publish := () to disable publishing. Examples usually use {}, but because () is allowed for normal methods, we're back to number 1.
Macro definition:
Macro usage:
This fails to compile with the error:
If
id
is not a macro, this compiles and prints()
as expected. Workarounds include not using infix or a right hand side of(())
or {}.The text was updated successfully, but these errors were encountered: