Skip to content

Instantly share code, notes, and snippets.

@cgrand
Created July 3, 2021 13:19
Show Gist options
  • Save cgrand/c495746ed844cac06a364ee41b322149 to your computer and use it in GitHub Desktop.
Save cgrand/c495746ed844cac06a364ee41b322149 to your computer and use it in GitHub Desktop.
lazy init
log(String msg, x) {
print(msg);
return x;
}
var a = log("Init A", 1);
var b = log("Init B", 2);
var c = log("Init C", 3);
main() {
print(b);
print(a);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment