[melbourne-pug] mapping strings to class attributes/operators etc.

Tennessee Leeuwenburg tennessee at tennessee.id.au
Sun Jan 8 01:44:47 CET 2006


One way, of course, would be with some kind of class which has a run 
method. You could instantiate a new instance of each class, store each 
in a dictionary indexed by keyword, then call 
BagOfInstances["keyword"].run()

I don't *think* you can simply store methods directly into a dictionary, 
but I might be wrong. It could be possible to do 
BagOfInstances["keyword"] = methodName and be done with it.

Cheers,
-T


More information about the melbourne-pug mailing list