Skip to content

Instantly share code, notes, and snippets.

@tomjack
Created December 10, 2011 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomjack/931f7ffaccdffbf97d8d to your computer and use it in GitHub Desktop.
Save tomjack/931f7ffaccdffbf97d8d to your computer and use it in GitHub Desktop.
From 826742d4f070fb64e056e914d2a5cbc05cd4b162 Mon Sep 17 00:00:00 2001
From: Thomas Jack <thomasjack@gmail.com>
Date: Sat, 10 Dec 2011 11:53:27 -0600
Subject: [PATCH] ignore BigInt in Clojure 1.2
---
src/clj/carbonite/serializer.clj | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/clj/carbonite/serializer.clj b/src/clj/carbonite/serializer.clj
index b3e4b09..0b0bfb2 100644
--- a/src/clj/carbonite/serializer.clj
+++ b/src/clj/carbonite/serializer.clj
@@ -10,7 +10,7 @@
[java.net URI]
[java.util Date UUID]
[java.sql Time Timestamp]
- [clojure.lang BigInt Keyword Symbol PersistentArrayMap
+ [clojure.lang Keyword Symbol PersistentArrayMap
PersistentHashMap MapEntry PersistentStructMap
PersistentVector PersistentHashSet
Cons PersistentList PersistentList$EmptyList
@@ -138,10 +138,13 @@
(def ^{:doc "Define a map of Clojure primitives and their serializers
to install."}
clojure-primitives
- (array-map
- BigInt clojure-reader-serializer
- Keyword clojure-reader-serializer
- Symbol clojure-reader-serializer))
+ (let [prims (array-map
+ Keyword clojure-reader-serializer
+ Symbol clojure-reader-serializer)]
+ (if-let [big-int (try (Class/forName "clojure.lang.BigInt")
+ (catch ClassNotFoundException _))]
+ (assoc prims big-int clojure-reader-serializer)
+ prims)))
(def java-primitives
(array-map
--
1.7.5.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment