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

Return value from deflike macros is ignored #499

Closed
zampino opened this issue May 30, 2023 · 0 comments · Fixed by #484
Closed

Return value from deflike macros is ignored #499

zampino opened this issue May 30, 2023 · 0 comments · Fixed by #484
Labels
bug Something isn't working

Comments

@zampino
Copy link
Collaborator

zampino commented May 30, 2023

Reproduces with

(ns scratch.debug
  (:require [nextjournal.clerk :as clerk]))

(defmacro defmy [name body]
  `(do
     (def ~name ~body)
     (clerk/html [:h1.bg-green-200 "Defined: " [:span.font-mono.bg-slate-200 '~name]])))

(defmy stuff [1 2 3])

renders as
CleanShot 2023-05-30 at 16 34 58@2x
instead of
CleanShot 2023-05-30 at 16 34 06@2x

This is because the macro name starts with def and it defines exactly one var.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant