あるClojure名前空間の関数bene-csv.coreを別の名前空間bene-cmp.coreから呼び出すにはどうすればよいですか?:requireと:useのさまざまなフレーバーを試しましたが、成功しませんでした。
bene-csvの関数は次のとおりです。
(defn ret-csv-data
"Returns a lazy sequence generated by parse-csv.
Uses open-csv-file which will return a nil, if
there is an exception in opening fnam.
parse-csv called on non-nil file, and that
data is returned."
[fnam]
(let [ csv-file (open-csv-file fnam)
csv-data (if-not (nil? csv-file)
(parse-csv csv-file)
nil)]
csv-data))
bene-cmp.coreのヘッダーは次のとおりです。
(ns bene-cmp.core
.
.
.
(:gen-class)
(:use [clojure.tools.cli])
(:require [clojure.string :as cstr])
(:use bene-csv.core)
(:use clojure-csv.core)
.
.
.
(bene-cmp.core)の呼び出し元の関数(現在はスタブ)
defn fetch-csv-data
"This function merely loads the two csv file arguments."
[benetrak-csv-file gic-billing-file]
(let [benetrak-csv-data ret-csv-data]))
bene-cmp.cljのヘッダーを変更した場合
(:require [bene-csv.core :as bcsv])
呼び出しをret-csv-dataに変更します
(defn fetch-csv-data
"This function merely loads the two csv file arguments."
[benetrak-csv-file gic-billing-file]
(let [benetrak-csv-data bcsv/ret-csv-data]))
このエラーが発生します
原因:java.lang.RuntimeException:そのような変数はありません:bcsv / ret-csv-data
では、fetch-csv-dataを呼び出すにはどうすればよいですか?ありがとうございました。