Skip to content

0.13.5

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 06 Dec 01:26
· 12 commits to master since this release
76f9087
  • motoko (moc)

    • Breaking change (minor):

      • Add new keyword transient with exactly the same meaning as the old keyword flexible (but a more familiar reading).

      • Add keyword persistent.

        When used to modify the actor keyword in an actor or actor class definition, the keyword declares that the default stability of a
        let or var declaration is stable (not flexible or transient).

        For example, a stateful counter can now be declared as:

        persistent actor {
        
          // counts increments since last upgrade
          transient var invocations = 0;
        
          // counts increments since first installation
          var value = 0; 	// implicitly `stable`
        
          public func inc() : async () {
            value += 1;
            invocations += 1;
          }
        
        }

        On upgrade, the transient variable invocations will be reset to 0 and value, now implicitly stable, will retain its current value.

        Legacy actors and classes declared without the persistent keyword have the same semantics as before.

    • Added new primitive replyDeadline : () -> Nat64 to obtain when a response for a best-effort message is due (#4795).

    • bugfix: fail-fast by limiting subtyping depth to avoid reliance on unpredictable stack overflow (#3057, #4798).

  • motoko-base