Compare commits

...

2 Commits

Author SHA1 Message Date
Scott Richmond
608ab4ab67 stringify fns and bugfixes 2024-05-19 14:54:51 -04:00
Scott Richmond
70bff13eea add ref to main switch 2024-05-19 14:54:37 -04:00
2 changed files with 8 additions and 5 deletions

View File

@ -221,9 +221,11 @@
", "))
(defn- stringify* [value]
(def typed? (when (dictionary? value) (value :^type)))
(def type (if typed? typed? (type value)))
(print "stringifying " (string value))
(def typed? (when (dictionary? value)
(print "value is a dictionary")
(value :^type)))
(def type (if typed? typed? (type value)))
(case type
:nil ""
:number (string value)
@ -238,6 +240,7 @@
:set
(string/join (map stringify (keys value)) ", ")
:ref (stringify (value :^value))
:fn (string "fn " (value :name))
# XXX: pkg, fn
))
@ -502,10 +505,9 @@
(do
(set source `
fn foo () -> :foo
let bar = #{foo}
bar :foo ()
#{:a 1, :b 2}
`)
(def result (run))
(stringify result)
)

View File

@ -615,6 +615,7 @@ Imports are for a later iteration of Ludus:
:use (usee validator)
:loop (loopp validator)
:recur (recur validator)
:ref (ref validator)
(error (string "unknown node type " type)))))
(set validate validate*)