Archives Scala确实非常适合实现DSL
Post
Cancel

Scala确实非常适合实现DSL

用了一上午的时间,就实现了xpath的解释,类似这样的东西:a[@b==”1” and (c/@d==2 or e[f==”abc”])]。再加上Scala对函数对象的支持以及函数名的随意性,很容易就实现了对xml操作的扩展。除了Scala定义好的”\”,”\”,加入了”\%”来支持复杂的xpath,跟dom4j差不多了。真爽!

This post is licensed under CC BY 4.0 by the author.

Scala的XML处理非常强大

Scala的XML是只读的

Comments powered by Disqus.