The above program has basically calculates the number of keys between "script1_" inclusive and "script2_" exclusive. It's really compact flexible and powerful.
Now, before you run off and think about implementing this yourself. First have a look at kitten:
https://kittenlang.org/
Anyway, in the specific case of joy is more difficult to dig up. Here's an example (I know it, because I implemented it): https://github.com/openvstorage/arakoon/blob/lsl/src/system/...
The above program has basically calculates the number of keys between "script1_" inclusive and "script2_" exclusive. It's really compact flexible and powerful.Now, before you run off and think about implementing this yourself. First have a look at kitten: https://kittenlang.org/