I was just grousing about all the extra backwhacking of regexes in lisps, and like ... why don't lisps have #// regex readers? This seems like a neat and simple solution to that problem. Just turn #/regex/ into (make-regexp "regex-with-doubled-backslashes") and everybody's happy.
@elb
Proximally, I was thinking recently it was because #/ was the character dispatch macro in zetalisp in the early 80s. Now it's #\, but I had to add #/ as the "zetalisp character dispatch macro" to run some zetalisp code recently. So there's a reason to choose something else. Also ~/foo:bar/ is a format control in lisp (call the exported bar from foo on the output stream).
To my knowledge, it's encouraged to use the unused bracket characters for this kind of stuff.
@tfb @pymander
@screwtape
I could easily be sold on some syntax other than #//, just so long as my regexps don't turn into \\\\(\\\\) all over the place!
@tfb @pymander
@screwtape Yeah, probably a generalized robustly-quoted string syntax and passing it to the regexp compilation function would be fine, and it would also solve other string quoting struggles.
@tfb @pymander
I was kind of hoping there would be a nice series expression that just "was regex", but I didn't find it yet.
(require :series)
(series::install)
(let ((to-filter (scan '(a b c d e)))
(filters (series '(b d))))
(collect
(choose
(#Mmember to-filter filters)
to-filter)))
(series::install :remove t)
There are only five candidate decades for someone to have written it in, I'll find it eventually..