如何在用户定义的命名空间中启动 REPL? [英] How do I start the REPL in a user defined namespace?

查看:14
本文介绍了如何在用户定义的命名空间中启动 REPL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(in-ns 'dbx) 写入文件并加载它不会更改 repl 的默认命名空间(使用 cygwin/console).命名空间仍然是 user=>,而不是 dbx=>.

Writing (in-ns 'dbx) to a file and loading it isn't changing the default namespace of the repl (using cygwin/console). The namespace is still user=>, not dbx=>.

vikrant[28] clj
Clojure 1.3.0
user=> (load-file "try1.clj")
#(Namespace dbx)
user=>

我们如何在脚本文件中定义的命名空间中启动 REPL?

How can we start the REPL in a namespace defined in a script file?

推荐答案

java -cp .;clojure-1.3.0.jar; clojure.main -e 
"(ns dbx) (clojure.main/repl) (in-ns 'dbx) (clojure.core/use 'clojure.core)"

这篇关于如何在用户定义的命名空间中启动 REPL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆