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
Implement a heuristic which designates a function as "pure". There may be a want for "attribute" syntax i.e. @pure to force a declaration to be pure, and make it a compile time error not to.
A pure function doesn't touch any external state, or handle any references.
Purity could be used to replace two identical functions with the same parameters with the same result. Slices may be stack allocated when only ever passed into pure functions. Note that in this latter case, returning inhibits this optimization as well.
See CtorExpr compiler method and its many TODOs
The text was updated successfully, but these errors were encountered:
Implement a heuristic which designates a function as "pure". There may be a want for "attribute" syntax i.e.
@pure
to force a declaration to be pure, and make it a compile time error not to.A pure function doesn't touch any external state, or handle any references.
Purity could be used to replace two identical functions with the same parameters with the same result. Slices may be stack allocated when only ever passed into pure functions. Note that in this latter case, returning inhibits this optimization as well.
See CtorExpr compiler method and its many TODOs
The text was updated successfully, but these errors were encountered: