首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >没有这样的命名空间: quil.helpers.seqs

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

Stack Overflow用户
提问于 2022-10-14 21:00:03
回答 1查看 38关注 0票数 0

我是通过和Quil玩来学ClojureScript的。当我试图在这个Quil示例中实现ClojureScript时,我收到了错误消息:No such namespace: quil.helpers.seqs

可以通过使用lein:lein new quil-cljs quil-helpers创建一个新项目并尝试在core.cljs文件中使用quil.helpers.seqs中的一个函数来再现此错误。

我为什么要犯这个错误?

下面是我尝试使用来自这个命名空间的函数的core.cljs文件:

代码语言:javascript
复制
(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文件:

代码语言:javascript
复制
(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}}]})
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-10-14 21:06:44

如您所见,在回购中是一个CLJ名称空间--您不能像在CLJS中那样使用它。但是不知道为什么它是一个CLJ似乎没有什么JVM特定的,所以也许它是值得创建一个特性请求。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74074822

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档