Note about :scittle reader conditional. (#104)

This commit is contained in:
Chris McCormick 2025-03-09 18:59:16 +08:00 committed by GitHub
parent f65ba9d853
commit fc6c2a9643
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -147,6 +147,19 @@
addition to <tt>scittle.js</tt>, you need to addition to <tt>scittle.js</tt>, you need to
include <tt>scittle.pprint.js</tt>. include <tt>scittle.pprint.js</tt>.
<a name="reader-conditional"></a>
<h2><a href="#reader-conditional">Target :scittle in cljc</a></h2>
You can target scittle in .cljc files (use a script tag to include the cljc file) with the <code>:scittle</code> reader conditional like this:<br>
<pre><code class="clojure">
#?(:scittle
(js/console.log "In scittle")
:org.babashka/nbb
(js/console.log "In nbb")
:cljs
(js/console.log "In cljs"))
</code></pre>
<a name="repl"></a> <a name="repl"></a>
<h2><a href="#nrepl">REPL</a></h2> <h2><a href="#nrepl">REPL</a></h2>