Skip to content

Instantly share code, notes, and snippets.

@robotlolita
Created October 16, 2011 20:14
Show Gist options
  • Save robotlolita/1291364 to your computer and use it in GitHub Desktop.
Save robotlolita/1291364 to your computer and use it in GitHub Desktop.
var Talkable = {
talk: function(){
return this.name + ': ' + this.speech()
}
}
var Animal = Object |> {
trait Talkable,
name: 'Animal',
get speech() '...'
}
var Cat = Animal |> {
name: 'Cat',
get speech() 'meow'
}
var nyan = Cat |> { name: 'Nyan nyan nyan' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment