Created
June 6, 2014 12:50
-
-
Save cgrand/8259134d266191436636 to your computer and use it in GitHub Desktop.
Here is what I hacked on my flight back from Helsinki
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; regexps on seqables, implemented using a Pike and Janson vm. | |
; linear with the size of the input, supports greedy and reluctant operators. | |
=> (exec (as :whole | |
(as :pre | |
(* odd?) #(== 3 %)) | |
(* (constantly true)) | |
#(== 7 %)) | |
[1 3 3 7]) | |
{:pre (1 3 3), :whole (1 3 3 7)} | |
=> (exec (as :whole | |
(as :pre | |
(*? odd?) #(== 3 %)) | |
(* (constantly true)) | |
#(== 7 %)) | |
[1 3 3 7]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment