如果我创建一个新项目
lein new quil foo
然后将 src/foo/core.clj 减少到
(ns foo.core
(:require [quil.core :as q]
[quil.middleware :as m]))
(defn draw [state]
(if (< (rand) 0.5)
(q/line 0 0 500 500)
(q/line 0 500 500 0)))
(q/defsketch foo
:title "Try this at home"
:size [500 500]
:draw draw
:features [:keep-on-top]
:middleware [m/fun-mode])
lein repl
并在with中评估程序(use 'foo.core)
,两条线都被绘制(即我得到一个大 X)。(if (< (rand) 0.5) true false)
按预期工作,所以我错过了什么?