Skip to content

Instantly share code, notes, and snippets.

@mraleph
Created July 4, 2013 13:50
Show Gist options
  • Save mraleph/5927922 to your computer and use it in GitHub Desktop.
Save mraleph/5927922 to your computer and use it in GitHub Desktop.
class Step {
operator - (_) => this;
operator > (other) => new Seq(this, other);
}
class Atom extends Step {
final name;
Atom(this.name);
toString() => "${name}";
}
class Seq extends Step {
final x, y;
Seq(this.x, this.y);
toString() => "${x} => ${y}";
}
var x = new Atom("x"); // Unfortunately can't be final for we use -- on it :-/
var y = new Atom("y");
var z = new Atom("z");
main() {
print (x --> y --> z); // x => y => z
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment