Skip to content

Make all Integers immutable #47

Open
@make-github-pseudonymous-again

Description

  • 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).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions