For more fun, as brilliantly exploited by Jukka Suomela in
TPR(0,4b),
notice that perl itself has a built-in topological sorter: the garbage collector. Chris Dolan's
explanation can be found
here.
| [reply] |
That looks entertaining ... but I'm not sure I would want to rely on it for production code. First off, I can't quite get my head around the code. Even the de-obfuscated version. (I'm not entirely sure if this will work in a larger program, or if it only works in a standalone perl VM, for example.) Secondly, I'm not sure if PONIE will support this type of GC or not. I'm hoping that lots of this code will survive into Perl6, and Sort::Topological looks more likely to make that jump.
But, thanks for the ever-present extra WTDI. :-)
| [reply] |