Robert Bradshaw wrote: > 1) Adding a phase doesn't require adding a new function to every node > in the tree.
That needn't be necessary anyway. The ExprNodes currently have a list of names of attributes that refer to subnodes. This allows a default implementation to be written for a pass that simply recurses into its subnodes. Then you only have to override it for nodes that need to do something different. Statement nodes don't currently have anything like that, but they could. > 2) The visitor pattern allows more flexibility in mutating the tree. > For example, the mutate_into_name_node function of AttributeNode > could be handled more naturally. I'll concede that one's a bit of a hack. It would be better to replace it with an actual NameNode, but the need for this becomes apparent too late in the process the way it currently works. -- Greg _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
