Skip to content

Commit

Permalink
Updated exports
Browse files Browse the repository at this point in the history
  • Loading branch information
EXPORTS-bot committed Nov 30, 2024
1 parent f22f4a0 commit 41a15b3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion exports/export.compact.edn
Original file line number Diff line number Diff line change
Expand Up @@ -7617,7 +7617,7 @@
";; be careful, with-redefs can permanently change a var if applied concurrently:\n\nuser> (defn ten [] 10)\n#'user/ten\nuser> (doall (pmap #(with-redefs [ten (fn [] %)] (ten)) (range 20 100)))\n...\nuser> (ten)\n79"
";; redefine var\n(def foo 1)\n#'user/foo\n(with-redefs [foo 2] foo)\n2\n\n;; redefine private var\n(ns first)\n(def ^:private foo 1)\n#'first/foo\n\n(ns second)\n(with-redefs [first/foo 2] @#'first/foo)\n2\n\n;; @#' is the macros of (deref (var first/foo))\n(with-redefs [first/foo 2] (deref (var first/foo))\n2"
";; Vars return to their previous value outside of `with-redefs` body\n\n(with-redefs [first last] (first [1 2]))\n;; => 2\n((with-redefs [first last] #(first [1 2])))\n;; => 1"
";; Macros are not stored in vars, so `with-redefs` doesn't work on them.\n(defmacro a [] 1)\n=> #'user/a\n(a)\n=> 1\n(with-redefs [a (constantly 2)] (a))\n=> 1"],
";; Macros are not stored in vars, so `with-redefs` doesn't work on them.\n(defmacro a [] 1)\n=> #'user/a\n(a)\n=> 1\n(with-redefs [a (constantly 2)] (a))\n=> 1\n\n;; Inlined functions are also not affected in their inlined form:\n(defn b {:inline (fn [_] 1)} [_] 1)\n(with-redefs [b (constantly 2)] (b :foo))\n=> 1\n;; but their non-inlined form will be affected:\n(with-redefs [b (constantly 2)] (map b [:foo :bar]))\n=> (2 2)"],
:macro true,
:notes nil,
:arglists ["bindings & body"],
Expand Down
2 changes: 1 addition & 1 deletion exports/export.compact.min.edn

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion exports/export.edn

Large diffs are not rendered by default.

0 comments on commit 41a15b3

Please sign in to comment.