Created
January 17, 2023 13:46
-
-
Save dimovich/161c0ee8dfdedbd7c3fcf6f11024f6f4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{:deps {org.clojure/clojurescript {:mvn/version "1.11.60"}}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; CLJ REPL | |
(require 'my.core) | |
(read-string (pr-str (my.core/circle 3))) | |
;;=> #my.core.Circle2{:p [0.0 0.0], :r 3} | |
;; CLJS REPL | |
(require 'my.core | |
'cljs.reader) | |
(cljs.reader/read-string (pr-str (my.core/circle 3))) | |
;;=> #my.core.Circle2{:p [0 0], :r {:p [0 0], :r 3}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{my.core.Circle2 my.core/circle} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns my.core) | |
(defrecord Circle2 [p r]) | |
(defn circle | |
([] (Circle2. [0.0 0.0] 1.0)) | |
([r] (Circle2. [0.0 0.0] r)) | |
([p r] (Circle2. [p p] r)) | |
([x y r] (Circle2. [x y] r))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment