Clojure:Lein跑不能解决符号

 往事不可味nd 发布于 2023-01-14 15:57
  • php
  • 我刚开始使用lein开始我的第一个clojure项目,代码在这里:

    (ns fileops.core
      (:use
        [clojure.core :only (slurp)]
        [clojure-csv.core :only (parse-csv)]
        [fileops.core]))
    
    (defn -main
      "I don't do a whole lot ... yet."
      [& args]
      (read-file "sample.csv"))
    
    (defn read-file
      "open and read the csv file"
      [fname]
      (with-open [file (clojure.java.io/reader fname)]
        (parse-csv (slurp fname))))
    

    我尝试使用"lein run"运行它,但我一直收到此错误:

    Caused by: java.lang.RuntimeException: Unable to resolve symbol: read-file in this context
        at clojure.lang.Util.runtimeException(Util.java:219)
        at clojure.lang.Compiler.resolveIn(Compiler.java:6874)
        at clojure.lang.Compiler.resolve(Compiler.java:6818)
        at clojure.lang.Compiler.analyzeSymbol(Compiler.java:6779)
        at clojure.lang.Compiler.analyze(Compiler.java:6343)
        ... 52 more
    

    我究竟做错了什么?

    撰写答案
    今天,你开发时遇到什么问题呢?
    立即提问
    热门标签
    PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
    Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有