是否可以将树(数据结构)传递给 clojure 并对其进行处理? [英] is it possible to pass a tree (data structure) to clojure and work on it?

查看:26
本文介绍了是否可以将树(数据结构)传递给 clojure 并对其进行处理?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从传递给 clojure REPL 的 java 代码构建的树结构,然后使用该数据结构对其进行处理.这棵树是ANTLR解析代码后形成的.

tree structure build by from java code passed to clojure REPL and then using that data structure work on it. this tree is formed by ANTLR after parsing the code.

推荐答案

您可以在项目中包含生成树的 java 类,并从 REPL 中调用它以获取对象.然后 Clojure 该对象满足您的需求:)

you could include the java class that produces the tree in your project and call it from the REPL to get an Object. then Clojure that Object to your hearts content :)

您需要做出的唯一真正决定是控制 Clojure 中的启动,然后调用 java 或其他方式.我个人认为在 Clojure 中开始更容易,因为我发现与 leiningen 一起工作比使用 maven 更愉快.

The only real decision you need to make is should control start in Clojure which then calls java or the other way around. I personally find it easier to start in Clojure because I find leiningen more pleasant to work with than maven.

这篇关于是否可以将树(数据结构)传递给 clojure 并对其进行处理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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