Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Migrated to maven

  • Loading branch information...
commit 5146212edecbd8d765028e165352d20005b44cc3 1 parent 8a5eeac
Ambrose Bonnaire-Sergeant frenchy64 authored
5 .gitignore
View
@@ -1,5 +1,2 @@
-pom.xml
*jar
-/lib/
-/classes/
-.lein-deps-sum
+/target/
2  README.md
View
@@ -264,7 +264,7 @@ For example, this syntax is illegal:
Matching single variables
---
-`match.core/match-1` is sugar over `match` that allows pattern matching over a single variable, without
+`clojure.core.match.core/match-1` is sugar over `match` that allows pattern matching over a single variable, without
an "extra" pair of `[]` around the occurances and each pattern row.
```clojure
49 pom.xml
View
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>core.match</artifactId>
+ <version>0.2.0-SNAPSHOT</version>
+ <name>${artifactId}</name>
+ <description>Optimized pattern matching and predicate dispatch for Clojure</description>
+
+ <licenses>
+ <license>
+ <name>Eclipse Public License 1.0</name>
+ <url>http://opensource.org/licenses/eclipse-1.0.php</url>
+ <distribution>repo</distribution>
+ </license>
+ </licenses>
+
+ <parent>
+ <groupId>org.clojure</groupId>
+ <artifactId>pom.contrib</artifactId>
+ <version>0.0.23</version>
+ </parent>
+
+ <issueManagement>
+ <system>jira</system>
+ <url>http://dev.clojure.org/jira/browse/MATCH</url>
+ </issueManagement>
+
+ <developers>
+ <developer>
+ <id>swannodette</id>
+ <name>David Nolen</name>
+ <url>http://dosync.posterous.com</url>
+ <roles>
+ <role>Project Lead</role>
+ </roles>
+ </developer>
+ <developer>
+ <id>frenchy64</id>
+ <name>Ambrose Bonnaire-Sergeant</name>
+ <url>http://twitter.com/ambrosebs</url>
+ </developer>
+ </developers>
+
+ <scm>
+ <connection>scm:git:git://github.com/clojure/core.match.git</connection>
+ <developerConnection>scm:git:git://github.com/clojure/core.match.git</developerConnection>
+ <url>http://github.com/clojure/core.match</url>
+ </scm>
+</project>
5 project.clj
View
@@ -1,5 +0,0 @@
-(defproject match "0.2.0-SNAPSHOT"
- :description "Optimized pattern matching and predicate dispatch for Clojure"
- :dev-dependencies [[swank-clojure "1.3.0-SNAPSHOT"]
- [lein-clojars "0.7.0"]
- [lein-marginalia "0.6.0"]])
6 src/match/array.clj → src/main/clojure/clojure/core/match/array.clj
View
@@ -1,11 +1,11 @@
-(ns match.array
+(ns clojure.core.match.array
(:refer-clojure :exclude [compile])
- (:use [match.core :as m]))
+ (:use [clojure.core.match.core :as m]))
;; =============================================================================
;; Shared
-(derive ::array ::match.core/vector)
+(derive ::array ::clojure.core.match.core/vector)
(defmethod nth-inline ::array
[t ocr i]
`(aget ~ocr ~i))
6 src/match/bits.clj → src/main/clojure/clojure/core/match/bits.clj
View
@@ -1,8 +1,8 @@
-(ns match.bits
+(ns clojure.core.match.bits
(:refer-clojure :exclude [compile])
- (:use [match.core :as m]))
+ (:use [clojure.core.match.core :as m]))
-(derive ::bits ::match.core/vector)
+(derive ::bits ::clojure.core.match.core/vector)
(defmethod check-size? ::bits
[_] false)
2  src/match/core.clj → src/main/clojure/clojure/core/match/core.clj
View
@@ -1,4 +1,4 @@
-(ns match.core
+(ns clojure.core.match.core
(:refer-clojure :exclude [compile])
(:require [clojure.set :as set])
(:import [java.io Writer]))
19 src/match/core/debug.clj → src/main/clojure/clojure/core/match/core/debug.clj
View
@@ -1,7 +1,8 @@
-(ns match.core.debug
+(ns clojure.core.match.core.debug
(:refer-clojure :exclude [compile])
- (:use [match.core :only [emit-matrix compile occurrences
- rows patterns action-for-row n-to-clj clj-form]])
+ (:use [clojure.core.match.core
+ :only [emit-matrix compile occurrences
+ rows patterns action-for-row n-to-clj clj-form]])
(:require [clojure.pprint :as pp]))
(defn source-pprint [source]
@@ -17,17 +18,17 @@
pprint-matrix))
(defmacro m-to-dag [vars & clauses]
- (binding [match.core/*line* (-> &form meta :line)
- match.core/*locals* &env
- match.core/*warned* (atom false)]
+ (binding [clojure.core.match.core/*line* (-> &form meta :line)
+ clojure.core.match.core/*locals* &env
+ clojure.core.match.core/*warned* (atom false)]
`~(-> (emit-matrix vars clauses)
compile
pp/pprint)))
(defmacro m-to-clj [vars & clauses]
- (binding [match.core/*line* (-> &form meta :line)
- match.core/*locals* &env
- match.core/*warned* (atom false)]
+ (binding [clojure.core.match.core/*line* (-> &form meta :line)
+ clojure.core.match.core/*locals* &env
+ clojure.core.match.core/*warned* (atom false)]
(try
(-> (clj-form vars clauses)
source-pprint)
4 src/match/date.clj → src/main/clojure/clojure/core/match/date.clj
View
@@ -1,5 +1,5 @@
-(ns match.date
- (:use [match.java :only [bean-match]]))
+(ns clojure.core.match.date
+ (:use [clojure.core.match.java :only [bean-match]]))
;; # Date Extension
;;
4 src/match/java.clj → src/main/clojure/clojure/core/match/java.clj
View
@@ -1,5 +1,5 @@
-(ns match.java
- (:use [match.core :only [IMatchLookup val-at* match]]
+(ns clojure.core.match.java
+ (:use [clojure.core.match.core :only [IMatchLookup val-at* match]]
[clojure.string :only [lower-case]]))
(def ^:private method-name-pattern #"^(is|get)([A-Z].*)$")
16 src/match/perf.clj → src/main/clojure/clojure/core/match/perf.clj
View
@@ -1,6 +1,6 @@
-(ns match.perf
+(ns clojure.core.match.perf
(:refer-clojure :exclude [compile])
- (:use [match.core :as m]))
+ (:use [clojure.core.match.core :as m]))
(comment
;; 2-3ms, literal match
@@ -52,9 +52,9 @@
(time
(dotimes [_ 1e7]
(match [x]
- [([_ _ 2] ::match.core/vector)] :a0
- [([1 1 3] ::match.core/vector)] :a1
- [([1 2 3] ::match.core/vector)] :a2)))))
+ [([_ _ 2] ::clojure.core.match.core/vector)] :a0
+ [([1 1 3] ::clojure.core.match.core/vector)] :a1
+ [([1 2 3] ::clojure.core.match.core/vector)] :a2)))))
;; 2.3s
(let [v [1 2 3 4]]
@@ -62,7 +62,7 @@
(time
(dotimes [_ 1e7]
(match [v]
- [([1 & r] ::match.core/vector)] :a0
+ [([1 & r] ::clojure.core.match.core/vector)] :a0
:else :a1)))))
;; 270ms
@@ -71,8 +71,8 @@
(time
(dotimes [_ 1e6]
(match [v]
- [([1 1 3 & r] ::match.core/vector)] :a0
- [([1 2 & r] ::match.core/vector)] :a1
+ [([1 1 3 & r] ::clojure.core.match.core/vector)] :a0
+ [([1 2 & r] ::clojure.core.match.core/vector)] :a1
:else :a3)))))
;; 90ms, destructure vector
6 src/match/regex.clj → src/main/clojure/clojure/core/match/regex.clj
View
@@ -1,6 +1,6 @@
-(ns match.regex
- (:use [match.core :only [emit-pattern to-source pattern-equals
- pattern-compare]])
+(ns clojure.core.match.regex
+ (:use [clojure.core.match.core
+ :only [emit-pattern to-source pattern-equals pattern-compare]])
(:import java.util.regex.Pattern))
;; # Regular Expression Extension
30 test/match/test/core.clj → src/test/clojure/clojure/core/match/test/core.clj
View
@@ -1,8 +1,8 @@
-(ns match.test.core
+(ns clojure.core.match.test.core
(:refer-clojure :exclude [compile])
- (:use match.core
- match.core.debug
- match.regex)
+ (:use clojure.core.match.core
+ clojure.core.match.core.debug
+ clojure.core.match.regex)
(:use [clojure.test]))
(deftest pattern-match-1
@@ -313,27 +313,27 @@
(deftest vector-pattern-match-1
(is (= (let [x [1 2 3]]
(match [x]
- [([_ _ 2] ::match.core/vector)] :a0
- [([1 1 3] ::match.core/vector)] :a1
- [([1 2 3] ::match.core/vector)] :a2
+ [([_ _ 2] ::clojure.core.match.core/vector)] :a0
+ [([1 1 3] ::clojure.core.match.core/vector)] :a1
+ [([1 2 3] ::clojure.core.match.core/vector)] :a2
:else :a3))
:a2)))
(deftest red-black-tree-pattern-1
(is (= (let [n [:black [:red [:red 1 2 3] 3 4] 5 6]]
(match [n]
- [([:black ([:red ([:red _ _ _] ::match.core/vector) _ _] ::match.core/vector) _ _] ::match.core/vector)] :valid
- [([:black ([:red _ _ ([:red _ _ _] ::match.core/vector)] ::match.core/vector) _ _] ::match.core/vector)] :valid
- [([:black _ _ ([:red ([:red _ _ _] ::match.core/vector) _ _] ::match.core/vector)] ::match.core/vector)] :valid
+ [([:black ([:red ([:red _ _ _] ::clojure.core.match.core/vector) _ _] ::clojure.core.match.core/vector) _ _] ::clojure.core.match.core/vector)] :valid
+ [([:black ([:red _ _ ([:red _ _ _] ::clojure.core.match.core/vector)] ::clojure.core.match.core/vector) _ _] ::clojure.core.match.core/vector)] :valid
+ [([:black _ _ ([:red ([:red _ _ _] ::clojure.core.match.core/vector) _ _] ::clojure.core.match.core/vector)] ::clojure.core.match.core/vector)] :valid
:else :invalid))
:valid)))
(deftest vector-pattern-rest-1
(is (= (let [v [1 2 3 4]]
(match [v]
- [([1 1 3 & r] ::match.core/vector)] :a0
- [([1 2 4 & r] ::match.core/vector)] :a1
- [([1 2 3 & r] ::match.core/vector)] :a2
+ [([1 1 3 & r] ::clojure.core.match.core/vector)] :a0
+ [([1 2 4 & r] ::clojure.core.match.core/vector)] :a1
+ [([1 2 3 & r] ::clojure.core.match.core/vector)] :a2
:else :a3))
:a2)))
@@ -341,8 +341,8 @@
(is (= (let [v [1 2 3 4]]
(let [v [1 2 3 4]]
(match [v]
- [([1 1 3 & r] ::match.core/vector)] :a0
- [([1 2 & r] ::match.core/vector)] :a1
+ [([1 1 3 & r] ::clojure.core.match.core/vector)] :a0
+ [([1 2 & r] ::clojure.core.match.core/vector)] :a1
:else :a3)))
:a1)))
6 test/match/test/core/error_msg.clj → ...lojure/clojure/core/match/test/core/error_msg.clj
View
@@ -1,7 +1,7 @@
-(ns match.test.core.error-msg
+(ns clojure.core.match.test.core.error-msg
(:refer-clojure :exclude [reify == inc compile])
- (:use [match.core]
- [match.core.debug])
+ (:use [clojure.core.match.core]
+ [clojure.core.match.core.debug])
(:use [clojure.test]))
(deftest match-errors-occurances-symbol
4 test/match/test/date.clj → src/test/clojure/clojure/core/match/test/date.clj
View
@@ -1,6 +1,6 @@
-(ns match.test.date
+(ns clojure.core.match.test.date
(:use clojure.test)
- (:use [match [core :only [match]] date]))
+ (:use [clojure.core.match [core :only [match]] date]))
(deftest date-test1
(is (= (match [(java.util.Date. 2010 10 1 12 30)]
6 test/match/test/java.clj → src/test/clojure/clojure/core/match/test/java.clj
View
@@ -1,7 +1,7 @@
-(ns match.test.java
+(ns clojure.core.match.test.java
(:refer-clojure :exclude [reify == inc compile])
- (:use [match.core]
- [match.java]
+ (:use [clojure.core.match.core]
+ [clojure.core.match.java]
[clojure.test]))
(bean-match java.util.Date)
4 test/match/test/regex.clj → src/test/clojure/clojure/core/match/test/regex.clj
View
@@ -1,5 +1,5 @@
-(ns match.test.regex
- (:use [match regex [core :only [match]]] )
+(ns clojure.core.match.test.regex
+ (:use [clojure.core.match regex [core :only [match]]] )
(:use clojure.test))
(deftest basic-regex
Please sign in to comment.
Something went wrong with that request. Please try again.