3 ms·
Author here. Pampy and Pampy.js (https://github.com/santinic/pampy.js https://github.com/santinic/pampy.js) are more similar to Lisp-style Pattern Matching. Of
by csantini 8y ago
Author here. Pampy and Pampy.js (https://github.com/santinic/pampy.js https://github.com/santinic/pampy.js) are more similar to Lisp-style Pattern Matching. Of course they cannot provide static analysis, but they can improve understandability, and they are useful with nested structures which are typical of how you solve problems in dynamic languages (less types, more nested dicts-and-lists).
An example:
pampy.matchAll(json, {_: {age: Number}}, (key, age) => age)
Finds any object with a Numeric age, that is value of any key in a json object we don't know the structure of.