Exhaustive pattern matching in Harbour - a working prototype

87 views
Skip to first unread message

Diego Pego

unread,
Jun 23, 2025, 3:12:20 PMJun 23
to Harbour Developers

Hey! I’ve put together a prototype for exhaustive pattern matching in Harbour, using pure Harbour and PP pragmas. The main idea is to have the compiler raise an error when a match (currently syntactic sugar for DO CASE) doesn't cover all possible cases for a given type.

You can check it out here:
https://github.com/diegopego/harbour-core/tree/master/contrib/diego

If you’re not familiar with exhaustive pattern matching, it ensures that all possible cases are handled explicitly at compile time. For a quick overview, these links give good context:

I’d love to hear your thoughts and feedback!

Reply all
Reply to author
Forward
0 new messages