Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/rmap/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
(print-method reftag *out*))

(defmethod print-method RVal [^rmap.core.RVal rval ^java.io.Writer writer]
(.write writer "??"))
(.write writer (str "(rval " (:ref/sexp (meta (.f rval))) ")")))

(defmethod simple-dispatch RVal [^rmap.core.RVal rval]
(print-method rval *out*))
Expand All @@ -64,7 +64,8 @@
not evaluated yet. The body can use the [[ref]] function while it is
evaluated, or you can bind it locally for use at a later stage."
[& body]
`(RVal. (fn [ref#]
`(RVal. ^{:ref/sexp '~@body}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unquote-splice would make the macro fail if the body contains multiple expressions like (rval (println "lazy!") "hi").

(fn [ref#]
(binding [ref ref#]
~@body))))

Expand Down