Last active
August 29, 2015 14:07
-
-
Save dastels/0e9d3cf0345bab0f6821 to your computer and use it in GitHub Desktop.
Comparison of NewtonScript and GoLisp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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