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
| (defn even-or-odd [] | |
| (let [x (atom 1)] | |
| (fn [] | |
| (cond | |
| (even? @x) (println "I am even") | |
| (odd? @x) (println "I am odd")) | |
| (swap! x inc)))) | |
| (def I-am-even-odder (even-or-odd)) | |
| (I-am-even-odder) |
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
| defn average | |
| numbers | |
| / | |
| apply + numbers | |
| count numbers |
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
| defn average | |
| numbers | |
| / | |
| apply + numbers | |
| count numbers |
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
| defn average | |
| numbers | |
| / | |
| apply + numbers | |
| count numbers |
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
| var foo, | |
| _this = this; | |
| foo = function() { | |
| return _this.bar; | |
| }; |
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
| foo = => @bar |
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
| somemethod: function() { | |
| var _this = this; | |
| return function() { | |
| return _this.someCall(); | |
| }; | |
| } |
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
| somemethod: -> | |
| => @someCall() |
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
| A = (function() { | |
| function A() { | |
| var _this = this; | |
| this.somemethod = function(paramlist) { | |
| return A.prototype.somemethod.apply(_this, arguments); | |
| }; | |
| } | |
| A.prototype.somemethod = function(paramlist) { |
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
| class A | |
| somemethod: (paramlist) => doSomethingHere(); |