没有这样的命名空间:quil.helpers.seqs

问题描述 投票:0回答:1

我正在通过使用 Quil 来学习 ClojureScript。当我尝试在 ClojureScript 中实现此 Quil 示例时,我收到错误消息:

No such namespace: quil.helpers.seqs

可以通过使用 lein:

lein new quil-cljs quil-helpers
创建一个新项目并尝试使用
quil.helpers.seqs
文件中
core.cljs
中的函数来重现该错误。

为什么我会收到此错误?

这是

core.cljs
文件,我在其中尝试使用此命名空间中的函数:

(ns quil-helpers.core
  (:require [quil.core :as q :include-macros true]
            [quil.helpers.seqs :as s]
            [quil.middleware :as m]))

(defn draw [state]
  (s/range-incl 0 10)
  (q/background 200)
  (q/ellipse 200 200 100 100))

(defn ^:export run-sketch []
  (q/defsketch quil-helpers
    :host "quil-helpers"
    :size [500 500]
    :draw draw
    :middleware [m/fun-mode]))

这是lein生成的project.clj文件:

(defproject quil-helpers "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.10.1"]
                 [quil "3.1.0"]
                 [org.clojure/clojurescript "1.10.520"]]

  :plugins [[lein-cljsbuild "1.1.7"]
            [lein-figwheel "0.5.19"]]
  :hooks [leiningen.cljsbuild]

  :clean-targets ^{:protect false} ["resources/public/js"]
  :cljsbuild
  {:builds [; development build with figwheel hot swap
            {:id "development"
             :source-paths ["src"]
             :figwheel true
             :compiler
             {:main "quil_helpers.core"
              :output-to "resources/public/js/main.js"
              :output-dir "resources/public/js/development"
              :asset-path "js/development"}}
            ; minified and bundled build for deployment
            {:id "optimized"
             :source-paths ["src"]
             :compiler
             {:main "quil_helpers.core"
              :output-to "resources/public/js/main.js"
              :output-dir "resources/public/js/optimized"
              :asset-path "js/optimized"
              :optimizations :advanced}}]})
clojurescript leiningen quil
1个回答
0
投票

正如您在存储库中看到的

quil.helpers.seqs
是一个CLJ命名空间——您不能像在CLJS中那样使用它。但不知道为什么它是 CLJ NS - 似乎没有任何特定于 JVM 的东西,所以也许值得创建一个功能请求。

© www.soinside.com 2019 - 2024. All rights reserved.