Compare commits
2 Commits
8d3d9a2dc5
...
608ab4ab67
Author | SHA1 | Date | |
---|---|---|---|
|
608ab4ab67 | ||
|
70bff13eea |
|
@ -221,9 +221,11 @@
|
||||||
", "))
|
", "))
|
||||||
|
|
||||||
(defn- stringify* [value]
|
(defn- stringify* [value]
|
||||||
(def typed? (when (dictionary? value) (value :^type)))
|
|
||||||
(def type (if typed? typed? (type value)))
|
|
||||||
(print "stringifying " (string 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
|
(case type
|
||||||
:nil ""
|
:nil ""
|
||||||
:number (string value)
|
:number (string value)
|
||||||
|
@ -238,6 +240,7 @@
|
||||||
:set
|
:set
|
||||||
(string/join (map stringify (keys value)) ", ")
|
(string/join (map stringify (keys value)) ", ")
|
||||||
:ref (stringify (value :^value))
|
:ref (stringify (value :^value))
|
||||||
|
:fn (string "fn " (value :name))
|
||||||
# XXX: pkg, fn
|
# XXX: pkg, fn
|
||||||
))
|
))
|
||||||
|
|
||||||
|
@ -502,10 +505,9 @@
|
||||||
|
|
||||||
(do
|
(do
|
||||||
(set source `
|
(set source `
|
||||||
fn foo () -> :foo
|
#{:a 1, :b 2}
|
||||||
let bar = #{foo}
|
|
||||||
bar :foo ()
|
|
||||||
`)
|
`)
|
||||||
(def result (run))
|
(def result (run))
|
||||||
|
(stringify result)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -615,6 +615,7 @@ Imports are for a later iteration of Ludus:
|
||||||
:use (usee validator)
|
:use (usee validator)
|
||||||
:loop (loopp validator)
|
:loop (loopp validator)
|
||||||
:recur (recur validator)
|
:recur (recur validator)
|
||||||
|
:ref (ref validator)
|
||||||
(error (string "unknown node type " type)))))
|
(error (string "unknown node type " type)))))
|
||||||
|
|
||||||
(set validate validate*)
|
(set validate validate*)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user