Skip to content

Instantly share code, notes, and snippets.

@dastels
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dastels/0e9d3cf0345bab0f6821 to your computer and use it in GitHub Desktop.
Save dastels/0e9d3cf0345bab0f6821 to your computer and use it in GitHub Desktop.
Comparison of NewtonScript and GoLisp
NewtonScript
y := {YMethod: func () print("Y method"),
yVar: 14};
x := {Demo: func () begin
self.newVar := 37;
print(newVar);
self.NewMethod := func () print("hello");
self:NewMethod();
self._parent := y;
print(yVar);
self:YMethod();
end};
GoLisp
(define y {y-method: (lambda ()
(write-line "Y Method"))
y-var: 14})
(define x {demo: (lambda ()
(set! new-var 37)
(write-line new-var)
(set! new-method (lambda () (write-line "hello")))
(new-method)
(set! parent* y)
(write-line y-var)
(y-method))})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment