Skip to content

Instantly share code, notes, and snippets.

@josher19
Created May 16, 2012 08:57
Show Gist options
  • Save josher19/2708852 to your computer and use it in GitHub Desktop.
Save josher19/2708852 to your computer and use it in GitHub Desktop.
LiveScript: works in a file but not from command-line REPL
## 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