Lesson learned: I wasted hours yesterday chasing a bug due to my failing to use either macros or higher-order functions to enforce a simple invariant in calling a recursion scheme over two tries (that they be the same height). It's not worth the saving of a function call!
Yesterday: find and fix the bug.
Today: make a future variant of this bug inexpressible.

Yet another bug where structural types couldn't help me, since it's about how the values of two data structures are related at runtime.
I looked at the OCaml code I ported to Scheme... it had this bug, and many other bugs I found. Types only help you so much.
What idiot wrote this buggy code?

This idiot.

More like, what idiot trusted his types too much and failed to test his code enough?
You can follow @Ngnghm.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: