Created
May 16, 2012 08:57
-
-
Save josher19/2708852 to your computer and use it in GitHub Desktop.
LiveScript: works in a file but not from command-line REPL
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
## Looks like functions defined with `->` work but those defined with `function` do not. | |
answer = 42 | |
deepthought = -> "let me think about it for a while" | |
function question then answer | |
console.assert deepthought! == 'let me think about it for a while' | |
console.log deepthought! | |
console.assert question! == answer | |
console.log question! | |
console.assert answer == 42 | |
console.log "done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment