Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regex in quoted form is unevaluated #741

Open
borkdude opened this issue Dec 24, 2024 · 0 comments
Open

regex in quoted form is unevaluated #741

borkdude opened this issue Dec 24, 2024 · 0 comments

Comments

@borkdude
Copy link
Collaborator

borkdude commented Dec 24, 2024

The following notebook fails:

(ns scratch
  (:require [nextjournal.clerk :as clerk]
            [clojure.core :as b]))

(defn regex [re]
  (re-find re "my string"))

(regex '#"my")

because the regular expression is read as (clojure.core/re-pattern ...) due to an option in edamame. But when using a regex in quotes, this form remains unevaluated.
The option to read regexes as a call to clojure.core/re-pattern is provided to edamame to fix equality semantics between regexes: #84 but unfortunately this doesn't work properly when the regex occurs in a quoted form.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant