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
Add a special flag property to mark an Integer as immutable.
Require user to a.clone() every integer that he wants to use later (or a.freeze(), or a.copy(), not so sure about the name) before any instruction on them is called. This sets the immutable flag.
Remove all i(n) instructions, instead all remaining instructions can exploit the fact that an operand is not marked as immutable to save on computation time.
Exploit class inheritance: have special classes for some small constants with hardcoded instructions. Always mark them as immutable.
This would allow Integers to be used as keys in search trees and tables (by inserting only freezed instances).
The text was updated successfully, but these errors were encountered:
a.clone()
every integer that he wants to use later (ora.freeze()
, ora.copy()
, not so sure about the name) before any instruction on them is called. This sets the immutable flag.i(n)
instructions, instead all remaining instructions can exploit the fact that an operand is not marked as immutable to save on computation time.This would allow Integers to be used as keys in search trees and tables (by inserting only freezed instances).
The text was updated successfully, but these errors were encountered: