Skip to content

Instantly share code, notes, and snippets.

@egonelbre
Created December 18, 2012 11:04
Show Gist options
  • Save egonelbre/4327151 to your computer and use it in GitHub Desktop.
Save egonelbre/4327151 to your computer and use it in GitHub Desktop.
function sayExt(obj){
return obj.say();
}
Zoo = Context(function(player){
Lion = Role({
say : function(){ return 'meow'; }
});
function sayInt(obj){
return obj.say();
}
lion = player.as(Lion);
return function(){
// what should be the expected output for these
log( sayExt(lion) ); // ??? meow or hmmm
log( sayInt(lion) ); // ??? meow
log( lion.toString() ); // meow
};
});
player = {say : function(){ return 'hmmm'; }};
zoo = Zoo(player);
zoo();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment