无法解决Clojure中的符号错误?

无法解决Clojure中的符号错误?,clojure,leiningen,Clojure,Leiningen,这是我的密码 (use '[leiningen.exec :only (deps)]) (deps '[[org.clojure/clojure "1.4.0"] [org.clojure/data.zip "0.1.1"]]) (deps '[[clj-http "0.5.8"] [org.clojars.rorygibson/clj-amazon "0.3.0-SNAPSHOT"]] ) (def ACCESS-KEY "my access key" ) (

这是我的密码

(use '[leiningen.exec :only (deps)])
(deps '[[org.clojure/clojure "1.4.0"]
       [org.clojure/data.zip "0.1.1"]])
(deps '[[clj-http "0.5.8"]
       [org.clojars.rorygibson/clj-amazon "0.3.0-SNAPSHOT"]]
  )

(def ACCESS-KEY "my access key" )
(def SECRET-KEY "my secret key" )
(def ASSOCIATE-ID "my id")

(def ENDPOINT "webservices.amazon.co.uk") 

(def signer (signed-request-helper ACCESS-KEY SECRETE-KEY ASSOCIATE-ID))

(def gibson-opus-search (item-search :signer signer :search-index "Books", :keywords "Neuromancer", :associate-tag ASSOCIATE-ID, :condition "New"))

(def lookup-specific-item (item-lookup :signer signer :associate-tag ASSOCIATE-ID :item-id "B0069KPSPC" :response-group   "ItemAttributes,OfferSummary"))

我试图在Clojure上使用Amazon的产品api。当我在命令提示符下尝试lein exec时,我无法在此上下文中解析symbol:signed request helper。如何解决此问题?

您从未在该上下文中定义
签名请求帮助程序,因此它当然无法解决。您需要提供一个定义,或者,如果它包含在一个依赖项中,则需要
使用
要求
适当的命名空间。

调用
deps
设置类路径,以便您的依赖项可用。您需要
require
一个名称空间来加载它,然后
reference
(在
require
中)使这些外部符号可用于您的代码。或者,您也可以
使用
外部名称空间来加载和
引用
(尽管现在通常不鼓励这样做)

在本例中:

(require '[clj-amazon.core :refer [signed-request-helper]]
         '[clj-amazon.product-advertising :refer [item-search item-lookup])
或:


通常首选
require
版本,因为这样可以直观地跟踪代码中使用的函数的来源。

出于特定原因,您是否使用lein deps而不是defproject?该错误表明未成功包含您的依赖项。
(use 'clj-amazon.core
     'clj-amazon.product-advertising)