简体   繁体   English

为什么在运行时出现错误(使用'clojure.contrib.repl-utils)?

[英]Why do I get an error when I run (use 'clojure.contrib.repl-utils)?

I found that I can use Chris Houser's repl-utils library (clojure.contrib.repl-utils/source or show) for poking into Java by reading Programming Clojure book page 20. 我发现我可以使用Chris Houser的repl-utils库(clojure.contrib.repl-utils / source或show)通过阅读《 Programming Clojure》第20页来戳入Java。

I searched the web and downloaded the 'clojure-contrib.jar', and set it as a part of classpath. 我在网上搜索并下载了“ clojure-contrib.jar”,并将其设置为类路径的一部分。

The problem is I can't run the following command 问题是我无法运行以下命令

(use 'clojure.contrib.repl-utils)

on both command line clojure and emacs/slime. 在命令行clojure和emacs / slime上。

What might be wrong? 可能是什么问题? Is Chirs Houser's library is different from 'clojure-contrib.jar'? Chirs Houser的图书馆与'clojure-contrib.jar'是否不同?

it works for me, we need more information to help you: what happend exactly when you run it? 它对我有用,我们需要更多信息来帮助您:当您运行它时,究竟发生了什么? does it raise an error? 它会引发错误吗?

FOUND A SOLUTION 找到解决方案

I asked and got some answers . 我问了一些答案

In short, - it's OK to have it require, but gives me an error to refer. 简而言之,-可以要求,但是给我一个错误。 As a result, I need to use as follows 结果,我需要使用如下

user=> (require 'clojure.contrib.repl-utils)
user=> (clojure.contrib.repl-utils/expression-info '(+ 1 2))
{:class java.lang.Number, :primitive? false}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么在 lein repl 中运行函数时会得到 FileNotFoundExpection? - Why do I get a FileNotFoundExpection when running a function in lein repl? 为什么我必须在org.clojure / clojure-contrib中添加依赖项才能使用dissoc-in? - Why am I having to add a dependency to org.clojure/clojure-contrib to use dissoc-in? 为什么在Clojure中使用(sh“ top”)时没有输出? - Why I get no output when use (sh “top”) in clojure? 为什么这个错误只出现在Clojure REPL的运行时? - Why does this error only show up in the run time in Clojure REPL? Vim和Clojure,我可以将Slimv或VimClojure与ritz或其他REPL一起使用吗? - Vim and Clojure, can I use Slimv or VimClojure with ritz or another REPL? 如何与Qt Jambi一起使用Clojure REPL? - How can I use the Clojure REPL together with Qt Jambi? Clojure:为什么会出现 StackOverflowError? - Clojure: Why do I get StackOverflowError? 如何让Clojure在REPL启动时加载项目特定的.clj文件? - How do I get Clojure to load a project-specific .clj file on REPL launch? 在Clojure repl中加载码头时,如何访问App Engine管理界面 - How do I access the app engine admin interface when loading jetty in the Clojure repl 使用clojure.main / repl时,如何获得类似readline / rlwrap的功能? - How can I get readline/rlwrap-like functionality when using clojure.main/repl?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM