Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Migrated to maven

  • Loading branch information...
commit 5146212edecbd8d765028e165352d20005b44cc3 1 parent 8a5eeac
Ambrose Bonnaire-Sergeant frenchy64 authored
5 .gitignore
... ... @@ -1,5 +1,2 @@
1   -pom.xml
2 1 *jar
3   -/lib/
4   -/classes/
5   -.lein-deps-sum
  2 +/target/
2  README.md
Source Rendered
@@ -264,7 +264,7 @@ For example, this syntax is illegal:
264 264 Matching single variables
265 265 ---
266 266
267   -`match.core/match-1` is sugar over `match` that allows pattern matching over a single variable, without
  267 +`clojure.core.match.core/match-1` is sugar over `match` that allows pattern matching over a single variable, without
268 268 an "extra" pair of `[]` around the occurances and each pattern row.
269 269
270 270 ```clojure
49 pom.xml
... ... @@ -0,0 +1,49 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<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">
  3 + <modelVersion>4.0.0</modelVersion>
  4 + <artifactId>core.match</artifactId>
  5 + <version>0.2.0-SNAPSHOT</version>
  6 + <name>${artifactId}</name>
  7 + <description>Optimized pattern matching and predicate dispatch for Clojure</description>
  8 +
  9 + <licenses>
  10 + <license>
  11 + <name>Eclipse Public License 1.0</name>
  12 + <url>http://opensource.org/licenses/eclipse-1.0.php</url>
  13 + <distribution>repo</distribution>
  14 + </license>
  15 + </licenses>
  16 +
  17 + <parent>
  18 + <groupId>org.clojure</groupId>
  19 + <artifactId>pom.contrib</artifactId>
  20 + <version>0.0.23</version>
  21 + </parent>
  22 +
  23 + <issueManagement>
  24 + <system>jira</system>
  25 + <url>http://dev.clojure.org/jira/browse/MATCH</url>
  26 + </issueManagement>
  27 +
  28 + <developers>
  29 + <developer>
  30 + <id>swannodette</id>
  31 + <name>David Nolen</name>
  32 + <url>http://dosync.posterous.com</url>
  33 + <roles>
  34 + <role>Project Lead</role>
  35 + </roles>
  36 + </developer>
  37 + <developer>
  38 + <id>frenchy64</id>
  39 + <name>Ambrose Bonnaire-Sergeant</name>
  40 + <url>http://twitter.com/ambrosebs</url>
  41 + </developer>
  42 + </developers>
  43 +
  44 + <scm>
  45 + <connection>scm:git:git://github.com/clojure/core.match.git</connection>
  46 + <developerConnection>scm:git:git://github.com/clojure/core.match.git</developerConnection>
  47 + <url>http://github.com/clojure/core.match</url>
  48 + </scm>
  49 +</project>
5 project.clj
... ... @@ -1,5 +0,0 @@
1   -(defproject match "0.2.0-SNAPSHOT"
2   - :description "Optimized pattern matching and predicate dispatch for Clojure"
3   - :dev-dependencies [[swank-clojure "1.3.0-SNAPSHOT"]
4   - [lein-clojars "0.7.0"]
5   - [lein-marginalia "0.6.0"]])
6 src/match/array.clj → src/main/clojure/clojure/core/match/array.clj
... ... @@ -1,11 +1,11 @@
1   -(ns match.array
  1 +(ns clojure.core.match.array
2 2 (:refer-clojure :exclude [compile])
3   - (:use [match.core :as m]))
  3 + (:use [clojure.core.match.core :as m]))
4 4
5 5 ;; =============================================================================
6 6 ;; Shared
7 7
8   -(derive ::array ::match.core/vector)
  8 +(derive ::array ::clojure.core.match.core/vector)
9 9 (defmethod nth-inline ::array
10 10 [t ocr i]
11 11 `(aget ~ocr ~i))
6 src/match/bits.clj → src/main/clojure/clojure/core/match/bits.clj
... ... @@ -1,8 +1,8 @@
1   -(ns match.bits
  1 +(ns clojure.core.match.bits
2 2 (:refer-clojure :exclude [compile])
3   - (:use [match.core :as m]))
  3 + (:use [clojure.core.match.core :as m]))
4 4
5   -(derive ::bits ::match.core/vector)
  5 +(derive ::bits ::clojure.core.match.core/vector)
6 6
7 7 (defmethod check-size? ::bits
8 8 [_] false)
2  src/match/core.clj → src/main/clojure/clojure/core/match/core.clj
... ... @@ -1,4 +1,4 @@
1   -(ns match.core
  1 +(ns clojure.core.match.core
2 2 (:refer-clojure :exclude [compile])
3 3 (:require [clojure.set :as set])
4 4 (:import [java.io Writer]))
19 src/match/core/debug.clj → src/main/clojure/clojure/core/match/core/debug.clj
... ... @@ -1,7 +1,8 @@
1   -(ns match.core.debug
  1 +(ns clojure.core.match.core.debug
2 2 (:refer-clojure :exclude [compile])
3   - (:use [match.core :only [emit-matrix compile occurrences
4   - rows patterns action-for-row n-to-clj clj-form]])
  3 + (:use [clojure.core.match.core
  4 + :only [emit-matrix compile occurrences
  5 + rows patterns action-for-row n-to-clj clj-form]])
5 6 (:require [clojure.pprint :as pp]))
6 7
7 8 (defn source-pprint [source]
@@ -17,17 +18,17 @@
17 18 pprint-matrix))
18 19
19 20 (defmacro m-to-dag [vars & clauses]
20   - (binding [match.core/*line* (-> &form meta :line)
21   - match.core/*locals* &env
22   - match.core/*warned* (atom false)]
  21 + (binding [clojure.core.match.core/*line* (-> &form meta :line)
  22 + clojure.core.match.core/*locals* &env
  23 + clojure.core.match.core/*warned* (atom false)]
23 24 `~(-> (emit-matrix vars clauses)
24 25 compile
25 26 pp/pprint)))
26 27
27 28 (defmacro m-to-clj [vars & clauses]
28   - (binding [match.core/*line* (-> &form meta :line)
29   - match.core/*locals* &env
30   - match.core/*warned* (atom false)]
  29 + (binding [clojure.core.match.core/*line* (-> &form meta :line)
  30 + clojure.core.match.core/*locals* &env
  31 + clojure.core.match.core/*warned* (atom false)]
31 32 (try
32 33 (-> (clj-form vars clauses)
33 34 source-pprint)
4 src/match/date.clj → src/main/clojure/clojure/core/match/date.clj
... ... @@ -1,5 +1,5 @@
1   -(ns match.date
2   - (:use [match.java :only [bean-match]]))
  1 +(ns clojure.core.match.date
  2 + (:use [clojure.core.match.java :only [bean-match]]))
3 3
4 4 ;; # Date Extension
5 5 ;;
4 src/match/java.clj → src/main/clojure/clojure/core/match/java.clj
... ... @@ -1,5 +1,5 @@
1   -(ns match.java
2   - (:use [match.core :only [IMatchLookup val-at* match]]
  1 +(ns clojure.core.match.java
  2 + (:use [clojure.core.match.core :only [IMatchLookup val-at* match]]
3 3 [clojure.string :only [lower-case]]))
4 4
5 5 (def ^:private method-name-pattern #"^(is|get)([A-Z].*)$")
16 src/match/perf.clj → src/main/clojure/clojure/core/match/perf.clj
... ... @@ -1,6 +1,6 @@
1   -(ns match.perf
  1 +(ns clojure.core.match.perf
2 2 (:refer-clojure :exclude [compile])
3   - (:use [match.core :as m]))
  3 + (:use [clojure.core.match.core :as m]))
4 4
5 5 (comment
6 6 ;; 2-3ms, literal match
@@ -52,9 +52,9 @@
52 52 (time
53 53 (dotimes [_ 1e7]
54 54 (match [x]
55   - [([_ _ 2] ::match.core/vector)] :a0
56   - [([1 1 3] ::match.core/vector)] :a1
57   - [([1 2 3] ::match.core/vector)] :a2)))))
  55 + [([_ _ 2] ::clojure.core.match.core/vector)] :a0
  56 + [([1 1 3] ::clojure.core.match.core/vector)] :a1
  57 + [([1 2 3] ::clojure.core.match.core/vector)] :a2)))))
58 58
59 59 ;; 2.3s
60 60 (let [v [1 2 3 4]]
@@ -62,7 +62,7 @@
62 62 (time
63 63 (dotimes [_ 1e7]
64 64 (match [v]
65   - [([1 & r] ::match.core/vector)] :a0
  65 + [([1 & r] ::clojure.core.match.core/vector)] :a0
66 66 :else :a1)))))
67 67
68 68 ;; 270ms
@@ -71,8 +71,8 @@
71 71 (time
72 72 (dotimes [_ 1e6]
73 73 (match [v]
74   - [([1 1 3 & r] ::match.core/vector)] :a0
75   - [([1 2 & r] ::match.core/vector)] :a1
  74 + [([1 1 3 & r] ::clojure.core.match.core/vector)] :a0
  75 + [([1 2 & r] ::clojure.core.match.core/vector)] :a1
76 76 :else :a3)))))
77 77
78 78 ;; 90ms, destructure vector
6 src/match/regex.clj → src/main/clojure/clojure/core/match/regex.clj
... ... @@ -1,6 +1,6 @@
1   -(ns match.regex
2   - (:use [match.core :only [emit-pattern to-source pattern-equals
3   - pattern-compare]])
  1 +(ns clojure.core.match.regex
  2 + (:use [clojure.core.match.core
  3 + :only [emit-pattern to-source pattern-equals pattern-compare]])
4 4 (:import java.util.regex.Pattern))
5 5
6 6 ;; # Regular Expression Extension
30 test/match/test/core.clj → src/test/clojure/clojure/core/match/test/core.clj
... ... @@ -1,8 +1,8 @@
1   -(ns match.test.core
  1 +(ns clojure.core.match.test.core
2 2 (:refer-clojure :exclude [compile])
3   - (:use match.core
4   - match.core.debug
5   - match.regex)
  3 + (:use clojure.core.match.core
  4 + clojure.core.match.core.debug
  5 + clojure.core.match.regex)
6 6 (:use [clojure.test]))
7 7
8 8 (deftest pattern-match-1
@@ -313,27 +313,27 @@
313 313 (deftest vector-pattern-match-1
314 314 (is (= (let [x [1 2 3]]
315 315 (match [x]
316   - [([_ _ 2] ::match.core/vector)] :a0
317   - [([1 1 3] ::match.core/vector)] :a1
318   - [([1 2 3] ::match.core/vector)] :a2
  316 + [([_ _ 2] ::clojure.core.match.core/vector)] :a0
  317 + [([1 1 3] ::clojure.core.match.core/vector)] :a1
  318 + [([1 2 3] ::clojure.core.match.core/vector)] :a2
319 319 :else :a3))
320 320 :a2)))
321 321
322 322 (deftest red-black-tree-pattern-1
323 323 (is (= (let [n [:black [:red [:red 1 2 3] 3 4] 5 6]]
324 324 (match [n]
325   - [([:black ([:red ([:red _ _ _] ::match.core/vector) _ _] ::match.core/vector) _ _] ::match.core/vector)] :valid
326   - [([:black ([:red _ _ ([:red _ _ _] ::match.core/vector)] ::match.core/vector) _ _] ::match.core/vector)] :valid
327   - [([:black _ _ ([:red ([:red _ _ _] ::match.core/vector) _ _] ::match.core/vector)] ::match.core/vector)] :valid
  325 + [([:black ([:red ([:red _ _ _] ::clojure.core.match.core/vector) _ _] ::clojure.core.match.core/vector) _ _] ::clojure.core.match.core/vector)] :valid
  326 + [([:black ([:red _ _ ([:red _ _ _] ::clojure.core.match.core/vector)] ::clojure.core.match.core/vector) _ _] ::clojure.core.match.core/vector)] :valid
  327 + [([:black _ _ ([:red ([:red _ _ _] ::clojure.core.match.core/vector) _ _] ::clojure.core.match.core/vector)] ::clojure.core.match.core/vector)] :valid
328 328 :else :invalid))
329 329 :valid)))
330 330
331 331 (deftest vector-pattern-rest-1
332 332 (is (= (let [v [1 2 3 4]]
333 333 (match [v]
334   - [([1 1 3 & r] ::match.core/vector)] :a0
335   - [([1 2 4 & r] ::match.core/vector)] :a1
336   - [([1 2 3 & r] ::match.core/vector)] :a2
  334 + [([1 1 3 & r] ::clojure.core.match.core/vector)] :a0
  335 + [([1 2 4 & r] ::clojure.core.match.core/vector)] :a1
  336 + [([1 2 3 & r] ::clojure.core.match.core/vector)] :a2
337 337 :else :a3))
338 338 :a2)))
339 339
@@ -341,8 +341,8 @@
341 341 (is (= (let [v [1 2 3 4]]
342 342 (let [v [1 2 3 4]]
343 343 (match [v]
344   - [([1 1 3 & r] ::match.core/vector)] :a0
345   - [([1 2 & r] ::match.core/vector)] :a1
  344 + [([1 1 3 & r] ::clojure.core.match.core/vector)] :a0
  345 + [([1 2 & r] ::clojure.core.match.core/vector)] :a1
346 346 :else :a3)))
347 347 :a1)))
348 348
6 test/match/test/core/error_msg.clj → ...lojure/clojure/core/match/test/core/error_msg.clj
... ... @@ -1,7 +1,7 @@
1   -(ns match.test.core.error-msg
  1 +(ns clojure.core.match.test.core.error-msg
2 2 (:refer-clojure :exclude [reify == inc compile])
3   - (:use [match.core]
4   - [match.core.debug])
  3 + (:use [clojure.core.match.core]
  4 + [clojure.core.match.core.debug])
5 5 (:use [clojure.test]))
6 6
7 7 (deftest match-errors-occurances-symbol
4 test/match/test/date.clj → src/test/clojure/clojure/core/match/test/date.clj
... ... @@ -1,6 +1,6 @@
1   -(ns match.test.date
  1 +(ns clojure.core.match.test.date
2 2 (:use clojure.test)
3   - (:use [match [core :only [match]] date]))
  3 + (:use [clojure.core.match [core :only [match]] date]))
4 4
5 5 (deftest date-test1
6 6 (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
... ... @@ -1,7 +1,7 @@
1   -(ns match.test.java
  1 +(ns clojure.core.match.test.java
2 2 (:refer-clojure :exclude [reify == inc compile])
3   - (:use [match.core]
4   - [match.java]
  3 + (:use [clojure.core.match.core]
  4 + [clojure.core.match.java]
5 5 [clojure.test]))
6 6
7 7 (bean-match java.util.Date)
4 test/match/test/regex.clj → src/test/clojure/clojure/core/match/test/regex.clj
... ... @@ -1,5 +1,5 @@
1   -(ns match.test.regex
2   - (:use [match regex [core :only [match]]] )
  1 +(ns clojure.core.match.test.regex
  2 + (:use [clojure.core.match regex [core :only [match]]] )
3 3 (:use clojure.test))
4 4
5 5 (deftest basic-regex

0 comments on commit 5146212

Please sign in to comment.
Something went wrong with that request. Please try again.