Permalink
Browse files

Updates! Thanks @swannodette

  • Loading branch information...
1 parent 147e067 commit d2e23081fde21d93ef49e12f87f0c02bfe4e31a8 @mrb committed May 20, 2013
Showing with 19 additions and 3 deletions.
  1. +5 −1 README.md
  2. +14 −0 examples/examples.clj
  3. +0 −2 project.clj
View
6 README.md
@@ -115,8 +115,12 @@ end>
* Associate original jruby-parser node information as metadata to node map object, for altering and rehydrating source as ast
+## Credits
+
+* @swannodette for the amazing guidance and work on `nodeattro`, `mapo`, `filtero`, `rembero`, etc.
+
## License
-Copyright © 2013 Michael R. Bernstein
+Copyright © 2013 Michael R. Bernstein and contributors
Distributed under the Eclipse Public License, the same as Clojure.
View
14 examples/examples.clj
@@ -98,8 +98,22 @@
(filtero nodes
(fn [node]
(l/fresh [value]
+ (nodeattro node :type "DEFNNODE")
(nodeattro node :name value)
(l/!= value nil)))
nodes')
(mapo nodes' #(nodeattro %1 :name %2) q)))
+;; dupeo names
+(l/run* [q]
+ (l/fresh [nodes nodes' dupes]
+ (l/== nodes (parse-ruby-code ruby-code))
+ (filtero nodes
+ (fn [node]
+ (l/fresh [value]
+ (nodeattro node :type "DEFNNODE")
+ (nodeattro node :name value)
+ (l/!= value nil)))
+ nodes')
+ (mapo nodes' #(nodeattro %1 :name %2) dupes)
+ (dupeo dupes q)))
View
2 project.clj
@@ -4,7 +4,5 @@
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.5.0"]
- [org.clojure/algo.monads "0.1.4"]
[org.jruby/jrubyparser "0.4.1"]
- [org.clojure/core.logic "0.8.3"]
[rhizome "0.1.3"]])

0 comments on commit d2e2308

Please sign in to comment.