Fork me on GitHub
#calva
<
2023-07-05
>
Célio13:07:18

Howdy! I'm trying to add a crazy custom REPL command, and was wondering, is there a way to get the string representation of $current-form in Calva? What I'm trying to do is have a custom command that ns-unmap the symbol at the current form, e.g. (ns-unmap $ns $current-form) but I'm not able to do that because $current-form gets evaluated to its value, so I'd need its string representation instead so that I can do e.g. (ns-unmap $ns (symbol $current-form-string)).

pez13:07:36

Hi! $current-form gets inserted in your code template unevaluated. Then it gets evaluated when your custom command is evaluated if you do not quote it in some way. In your case it sounds like (ns-unmap $ns (symbol "$current-form")) would work.

👀 1
Célio13:07:54

Nice, it works! Thanks 🙂

🙏 1