Get rid of core shadow warnings.

This commit is contained in:
Scott Richmond 2022-04-03 22:20:31 -04:00
parent faca700cae
commit aa3692a141
5 changed files with 16 additions and 16 deletions

View File

@ -1 +1 @@
print ("foo, bar, and baz")
print("Hello, world.")

View File

@ -20,8 +20,8 @@
(pp/pprint (:errors parsed))
(System/exit 66))
(let [interpreted (interpreter/interpret parsed)]
(println " *** *** ***")
(println "I ran your script; here's the output: ")
;;(println " *** *** ***")
;;(println "I ran your script; here's the output: ")
(pp/pprint interpreted)
(System/exit 0)))))))

View File

@ -11,7 +11,7 @@
;; it's got runtime checking
;; we should be able to do these checks statically
;; that's for later, tho
(defn- resolve [word ctx-atom]
(defn- resolve-word[word ctx-atom]
(let [ctx @ctx-atom]
(if (contains? ctx word)
(get ctx word)
@ -207,7 +207,7 @@
::ast/atom (:value ast)
::ast/word (resolve (:word ast) ctx)
::ast/word (resolve-word(:word ast) ctx)
::ast/let (interpret-let ast ctx)

View File

@ -13,7 +13,7 @@
(defn- current [parser]
(nth (::tokens parser) (::token parser) nil))
(defn- peek [parser]
(defn- ppeek [parser]
(nth (::tokens parser) (inc (::token parser)) nil))
(defn- at-end? [parser]
@ -41,7 +41,7 @@
::token/rbrace
::token/eof})
(defn- sync [parser message origin end]
(defn- psync [parser message origin end]
(let [poison {::ast/type ::ast/poison
:message message
:origin origin
@ -63,7 +63,7 @@
(let [curr (current parser)
type (::token/type curr)]
(if (or (at-end? parser) (contains? sync-on type))
(sync parser message origin curr)
(psync parser message origin curr)
(recur (advance parser))))))))
;; some helper functions
@ -548,14 +548,14 @@
(parse-atom parser)
::token/keyword
(let [next (peek parser)
(let [next (ppeek parser)
type (::token/type next)]
(if (= type ::token/lparen)
(parse-synthetic parser)
(parse-atom parser)))
::token/word
(let [next (peek parser)
(let [next (ppeek parser)
type (::token/type next)]
(case type
(::token/lparen ::token/keyword) (parse-synthetic parser)

View File

@ -22,11 +22,11 @@
::data/type ::data/clj
:body /})
(def inc {:name "inc"
(def inc- {:name "inc"
::data/type ::data/clj
:body inc})
(def dec {:name "dec"
(def dec- {:name "dec"
::data/type ::data/clj
:body dec})
@ -38,7 +38,7 @@
::data/type ::data/clj
:body (fn [& args] (throw (ex-info "Ludus panicked!" {:args args})))})
(def print {:name "print"
(def print- {:name "print"
::data/type ::data/clj
:body (fn [& args]
(println (str args))
@ -47,10 +47,10 @@
(def prelude {"eq" eq
"add" add
"panic!" panic!
"print" print
"print" print-
"sub" sub
"mult" mult
"div" div
"inc" inc
"dec" dec
"inc" inc-
"dec" dec-
"not" not})