Skip to content

Instantly share code, notes, and snippets.

@mrb
mrb / parse_ruby.clj
Last active December 14, 2015 17:29
Using JRuby's Ruby Parser from Clojure
(ns graaaph.core
(:import (org.jrubyparser Parser
CompatVersion)
(org.jrubyparser.parser ParserConfiguration)
(org.jrubyparser.ast Node)
(java.io.StringReader))
(:require [clojure.zip :as z]))
(defn parse-ruby [ruby-string]
(let [config (ParserConfiguration. 0 (CompatVersion/RUBY1_9))
@willtim
willtim / clj_vtd_xml.clj
Created February 11, 2011 18:15
Simple Clojure API for VTD-XML - much faster than clojure.contrib.zip-filter.xml
(ns willtim.clj-vtd-xml
(:import [com.ximpleware VTDGen VTDNav AutoPilot])
(:require
[clojure.contrib.duck-streams :as ds]))
;;
;; Clojure API for VTD-XML
;;
;; Designed to work like clojure.contrib.zip-filter.xml, e.g.
;;