Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save seven-phases-max/7647414 to your computer and use it in GitHub Desktop.
Save seven-phases-max/7647414 to your computer and use it in GitHub Desktop.
// implementation:
.init-counter() {
.counter-wrapper(0);
} .init-counter();
.counter-wrapper(@new) {
.redefine() {
@counter: @new;
}
}
.inc() {
.redefine();
.counter-wrapper((@counter + 1));
x {counter: @counter}
}
// usage:
.inc();
.inc();
.inc();
a {
.inc();
}
b {
.inc();
}
c {
.inc();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment