【问题标题】:Is there a bug with foreign-libs in the cljsbuild repl?cljsbuild repl 中的外部库是否存在错误?
【发布时间】:2015-03-22 06:52:31
【问题描述】:

当我:

  1. clonecljs-webgl 项目,

  2. 编译:

    lein cljsbuild once

  3. 使用 repl 开始

    lein trampoline cljsbuild repl-listen

  4. 将以下内容粘贴到 REPL 中

`

  (ns learningwebgl.lesson-06
      (:require
        [WebGLUtils]
        [mat4]
        [learningwebgl.common :refer [init-gl init-shaders get-perspective-matrix
                                      get-position-matrix deg->rad animate load-image]]
        [cljs-webgl.buffers :refer [create-buffer clear-color-buffer clear-depth-buffer draw!]]
        [cljs-webgl.shaders :refer [get-attrib-location]]
        [cljs-webgl.constants.buffer-object :as buffer-object]
        [cljs-webgl.constants.capability :as capability]
        [cljs-webgl.constants.draw-mode :as draw-mode]
        [cljs-webgl.constants.data-type :as data-type]
        [cljs-webgl.constants.texture-parameter-name :as texture-parameter-name]
        [cljs-webgl.constants.texture-filter :as texture-filter]
        [cljs-webgl.constants.webgl :as webgl]
        [cljs-webgl.texture :refer [create-texture]]
        [cljs-webgl.typed-arrays :as ta]))`

我得到以下信息:

WARNING: No such namespace: WebGLUtils at line 1 <cljs repl>

(即使它在project.clj 中定义为:

:foreign-libs [
        {:file "resources/js/gl-matrix-min.js" :provides ["mat4","mat3","vec3"]}
        {:file "resources/js/webgl-utils.js" :provides ["WebGLUtils"]}]}

我的问题是:cljsbuild repl 中的外部库是否存在错误?

【问题讨论】:

  • 那么您找到解决方案了吗?
  • 还没有 - 这似乎是一个不平凡的修复

标签: clojure read-eval-print-loop clojurescript


【解决方案1】:

ClojureScript REPL 中的:foreign-libs 支持是相当新的,而 cljs-webgl 使用的是相当旧的编译器版本,没有支持。

【讨论】:

    猜你喜欢
    • 2012-09-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-11
    • 1970-01-01
    相关资源
    最近更新 更多