4 ms·
The callback way is more generic and prevents consing when you don't need to store the resulting node list. You may want to simply print something or maybe modi
by BoingBoomTschak 1y ago
The callback way is more generic and prevents consing when you don't need to store the resulting node list. You may want to simply print something or maybe modify the node in-place, for example.
- thesz 1y ago> modify the node in-place I consider this anti-pattern [1]. [1] https://web.archive.org/web/20070417190836/https://www.eecs.harvard.edu/~nr/pubs/zipcfg.pdf https://web.archive.org/web/20070417190836/https://www.eecs.... Authors found themselves fighting with control flow graph modifications and replaced mutable graph with immutable one, modified by zippers. They achieved speed up of 11% in optimizing transformations, some of which they were unable to implement in mutable version. E.g., more complex optimizations were working faster.