Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dirty constructor "flag" #233

Open
steinerkelvin opened this issue Nov 11, 2022 · 0 comments
Open

Dirty constructor "flag" #233

steinerkelvin opened this issue Nov 11, 2022 · 0 comments

Comments

@steinerkelvin
Copy link
Contributor

steinerkelvin commented Nov 11, 2022

A slightly different kind of constructor which acts like a function call: it reduces to itself and triggers further reduction on compute_at function.

It allows the user to signal that "this data has been recently created".

e.g.

(MyContract {Update}) =
  let x:xs = (Load);
  ask (Save {T2 (Inc x) xs});  // `Inc` inside of `T2` will not reduce when it's saved
  (Done #0)

(MyContract {Update}) =
  let x:xs = (Load);
  ask (Save {#T2 (Inc x) xs});  // `Inc` inside of `T2` will reduce when it's saved because `#T2` will be reduced itself
  (Done #0)

pub const DP0: u128 = 0x00;
pub const DP1: u128 = 0x01;
pub const VAR: u128 = 0x02;
pub const ARG: u128 = 0x03;
pub const ERA: u128 = 0x04;
pub const LAM: u128 = 0x05;
pub const APP: u128 = 0x06;
pub const SUP: u128 = 0x07;
pub const CTR: u128 = 0x08;
pub const CTS: u128 = 0x09;  // New memory cell / node
pub const FUN: u128 = 0x0A;
pub const OP2: u128 = 0x0B;
pub const NUM: u128 = 0x0C;
pub const NIL: u128 = 0x0F;
@steinerkelvin steinerkelvin changed the title Strict constructor Dirty constructor "flag" Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant