good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Non-word dispatch names make sense if you want to dispatch on the name of a condition, and the most convenient names that make sense are driven by external data.
For instance they may be driven off of filenames, which include characters like . and - in the names. For another instance, take a look at Why I like functional programming. Most of the names there are pieces of HTML tags. It is a piece of flexibility that you may not need most of the time, but when you do it is a lifesaver. As for length, if your dispatch table is so long that you want to put it into another file, nothing stops you from doing so. I think that the ease of doing it is pretty much equivalent with either syntax. If you really want the sub foo {...} syntax, then you can do it by adding a function called "new", and using OO to dynamically do the dispatch. In reply to Re^6: A short, "iffy" rant
by tilly
|
|