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
For simplicity and consistency, it could make sense for the shared keyword to always be optional for public actor methods. This would increase readability and reduce confusion about when the keyword is needed, e.g. when adding a caller to an existing method.
For example, instead of the following:
publicshared ({ caller }) func abc() { ... };
It could make sense to allow:
public ({ caller }) func abc() { ... };
This is an observation from reviewing the Motoko training samples. Is there anything from a technical standpoint that prevents us from making this change?
The text was updated successfully, but these errors were encountered:
For anyone reading this, note that the module in the above example does not actually include any public fields despite the public keyword.
Since the current grammar allows statements such as public 5 (but seemingly only at the end of an object/module/class), any usage of this is likely unintentional, so we may want to factor this out either way.
For simplicity and consistency, it could make sense for the
shared
keyword to always be optional for public actor methods. This would increase readability and reduce confusion about when the keyword is needed, e.g. when adding a caller to an existing method.For example, instead of the following:
It could make sense to allow:
This is an observation from reviewing the Motoko training samples. Is there anything from a technical standpoint that prevents us from making this change?
The text was updated successfully, but these errors were encountered: