Tag: pattern matching
-
Teaching old assert() new Tricks
Many languages have assert(). This post describes how assert() is implemented in Next Generation Shell and how these aspects/features are consistent with the rest of the language. Implied in the above is that the ideas below might not be a good fit for assert() in your favorite language or framework. Note that assert(EXPR, PATTERN) in…
-
Predicates, Upgraded
This post describes the thought process and implementation of moving from predicates to patterns while keeping this feature consistent with the rest of the language and compatible with existing code. Minimalistic example: Background While implementing the language, I’ve added higher order functions that seemed “obvious” to have in a language: Observation What I’ve noticed after…