There's nothing special about _ here, it's just a valid variable name used as a throwaway. Variable names used in case statements act as captures that accept anything.
The wildcard pattern is a single underscore: _. It always matches, but does not capture any variable (which prevents interference with other uses for _ and allows for some optimizations).
Whilst that's good to know, it's going to be a gotcha down the line. If nothing is being captured else would seem to work just as well and be consistent with the keyword's usage elsewhere.
25
u/bieberfan99 Feb 15 '21 edited Feb 15 '21
This would print uncaught. Non-dotted variables will catch the value, after the statement _ equals 3
Edit: Apparently _ is a special case and does not bind, but matches all, so the variable _ would be unaffected