The fanciest define of all time gets even more awesome

This is a new version of the fanciest define of all time a.k.a. match-generics.

match-generics

Destructuring in the car position

The 1.X releases could not destructure in car position.

So stuff like:

did work, but that (foo bar) had to be the same for every definition, and you could not use matchable’s various features in the car position either. You could have:

But you could not then also have:

Match-generics 2.1 removes this limitation.

Now this stuff works:

Faster

2.1 does a better job at clearing out unused branches but also swaps in case-lambda when it doesn’t need the full power of matchable. (And, just like the 1.X series, it swaps in vanilla lambda when it doesn’t need any fanciness at all.)

Backtracking and logic programming

Dispatching isn’t just on the args anymore.

The new version can also backtrack from specializations into generic fallbacks with the new require function.

⇒ (vanilla vanilla neapolitan)

Proxied content from gemini://idiomdrottning.org/fanciest-define-gets-even-more-awesome (external content)

Gemini request details:

Original URL
gemini://idiomdrottning.org/fanciest-define-gets-even-more-awesome
Status code
Success
Meta
text/gemini; lang=en
Proxied by
kineto

Be advised that no attempt was made to verify the remote SSL certificate.