Skip to content

Instantly share code, notes, and snippets.

@sebmarkbage
Created March 29, 2011 09:52
Show Gist options
  • Select an option

  • Save sebmarkbage/892109 to your computer and use it in GitHub Desktop.

Select an option

Save sebmarkbage/892109 to your computer and use it in GitHub Desktop.
class Point(x, y) extends Something {
move(x, y);
public X = 0, Y = 0;
public move(x, y) {
X = x;
Y = y;
repaint();
}
}
Point.fromString = function (s) {
return new Point(parse(s));
}
class Point {
X: 0,
Y: 0,
static fromString: function (s) {
return new Point(parse(s));
},
initialize: function (x, y) {
move(x, y);
},
move: function (x, y) {
X = x;
Y = y;
repaint();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment