Side question... he mentions how you can't quite achieve this "room" object in Python:
>you can’t turn to anonymous functions because Python doesn’t have them. You can’t use dot notation to dereference the fields inside the structure because Python uses [“key”] notation.
Why couldn't you subclass an object that has an 'on_enter' method? A nice side benefit would be that you'd be able to use dot notation to refer to its attributes!
class Kitchen(Location):
name = 'kitchen'
description = 'Your kitchen is untidy and cramped.'
visits = 0
def on_enter(self):
if (self.visits == 0):
#first time in this room
...
So far the magic of Javascript has been a bit over my head but I want to learn more. Why is this something you'd need anonymous functions to accomplish? (And why not just use Perl or some other language with them as opposed to JS?)