Comment by dataflow
2 days ago
What I would do in these cases is to define the general computation function, but special-case it to return the hard-coded value for specific common inputs if it's being evaluated at compile time. Then add a test to verify both behaviors.
No comments yet
Contribute on Hacker News ↗