add plugin with macro
This commit is contained in:
parent
0c0d5afacd
commit
11dd0a1d15
3 changed files with 41 additions and 1 deletions
21
test.html
Normal file
21
test.html
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<html>
|
||||
<head>
|
||||
<script src="./resources/public/js/scittle.js"></script>
|
||||
<script src="./resources/public/js/scittle.makro-plugin.js"></script>
|
||||
<script type="application/x-scittle">
|
||||
(require '[makro-plugin.core :as m])
|
||||
(defn my-alert []
|
||||
(.log js/console (m/add-low-fn 1 2 3 4 5 6))
|
||||
;; shows as expected in console: ["cljs.core/str", "__", 3, 4, [5, 6]]
|
||||
(.log js/console (m/add-low-makro 1 2 3 4 5 6)))
|
||||
;; shows unexpectedly the same ["cljs.core/str", "__", 3, 4, [5, 6]]
|
||||
;; instead of "__34[56]"
|
||||
(set! (.-my_alert js/window) my-alert)
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<button onclick="my_alert()">
|
||||
Click me!
|
||||
</button>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue