diff --git a/src/base.janet b/src/base.janet index 95203dd..34c1302 100644 --- a/src/base.janet +++ b/src/base.janet @@ -69,6 +69,13 @@ (pairs dict)) ", ")) +(defn- set-show [sett] + (def prepped (merge sett)) + (set (prepped :^type) nil) + (def shown (map show (keys prepped))) + (string/join shown ", ") +) + (defn- show* [x] (case (ludus/type x) :nil "nil" @@ -76,7 +83,7 @@ :tuple (string "(" (string/join (map show x) ", ") ")") :list (string "[" (string/join (map show x) ", ") "]") :dict (string "#{" (dict-show x) "}") - :set (string "${" (string/join (map show (keys x)) ", ") "}") + :set (string "${" (set-show x) "}") :box (string "box " (x :name) " [ " (show (x :^value)) " ]") :pkg (show-pkg x) (stringify x)))