Changes between Initial Version and Version 1 of Ticket #59783, comment 2
- Timestamp:
- 11/02/2023 08:15:20 AM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #59783, comment 2
initial v1 3 3 Much like the latter, `traverse_and_serialize_blocks()` takes a data structure (in our case, a block tree), traverses it, and applies a callback to each element it finds. 4 4 5 Granted, `traverse_and_serialize_blocks()` is somewhat more domain-specific a tit is traversing a tree of ''blocks'' rather than a more generic data structure; but within the domain of blocks and block trees, its applications are arguably comparably wide-ranging as `array_map()` is for arrays.5 Granted, `traverse_and_serialize_blocks()` is somewhat more domain-specific as it is traversing a tree of ''blocks'' rather than a more generic data structure; but within the domain of blocks and block trees, its applications are arguably comparably wide-ranging as `array_map()` is for arrays. 6 6 7 7 For a generic traversal tool like that, filters didn't seem like the right fit, much like one wouldn't want to add a filter before invoking `array_map` instead of passing a callback to it (and remembering to remove the filter afterwards!) While it's really only used inside of Core for now, it's conceivable that `traverse_and_serialize_blocks()` could be of some use to extenders.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)