-
Notifications
You must be signed in to change notification settings - Fork 177
Open
Description
The compiler can mark some objects as "pure" (similar to a pure function that always returns the same value if its arguments are the same).
An object is pure if it doesn't have lambda and all its kids are pure.
Also, an object can be made pure by adding apostrophe to its name:
[a b] > sum' ?
Here, the object sum is pure, but a copy of it may be not-pure (depending on a and b).
The compiler can wrap pure objects in PhPure decorator that simply caches the lambda() call.
In runtime, when a pure abstract object is used in application, the results becomes pure if all arguments are pure.
We can add .pure() function to the Phi interface, in order to enable the detection of purity in runtime.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels