Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate making fipp + puget work from source #1241

Closed
borkdude opened this issue Apr 14, 2022 · 1 comment
Closed

Investigate making fipp + puget work from source #1241

borkdude opened this issue Apr 14, 2022 · 1 comment

Comments

@borkdude
Copy link
Collaborator

borkdude commented Apr 14, 2022

Got something working locally:

Screen Shot 2022-04-14 at 21 41 16

Fipp diff:

diff --git a/src/fipp/deque.cljc b/src/fipp/deque.cljc
index 77f4b8f..86827e0 100644
--- a/src/fipp/deque.cljc
+++ b/src/fipp/deque.cljc
@@ -1,7 +1,7 @@
 (ns fipp.deque
   "Double-sided queue built on rrb vectors."
   (:refer-clojure :exclude [empty concat])
-  (:require [clojure.core.rrb-vector :as rrb]))
+  #?@(:bb [] :default [(:require [clojure.core.rrb-vector :as rrb])]))

 (def create vector)

@@ -13,6 +13,7 @@
 (def conjr (fnil conj empty))

 (defn conjlr [l deque r]
-  (rrb/catvec [l] deque [r]))
+  #?(:bb (reduce into [l] [deque [r]])
+     :default (rrb/catvec [l] deque [r])))

-(def concat rrb/catvec)
+(def concat #?(:bb into :default rrb/catvec))
diff --git a/src/fipp/ednize.clj b/src/fipp/ednize.clj
index 1af4dc2..2f5d3ea 100644
--- a/src/fipp/ednize.clj
+++ b/src/fipp/ednize.clj
@@ -25,7 +25,7 @@
     (tagged-literal 'object [cls id rep])))

 (defn format-hack [v x]
-  (let [local ^java.lang.ThreadLocal @v
+  #_(let [local ^java.lang.ThreadLocal @v
         fmt ^java.text.SimpleDateFormat (.get local)]
     (.format fmt x)))

diff --git a/src/fipp/ednize/instant.clj b/src/fipp/ednize/instant.clj
index 4bde9f1..09a1799 100644
--- a/src/fipp/ednize/instant.clj
+++ b/src/fipp/ednize/instant.clj
@@ -2,10 +2,10 @@
   "Provides features that may not be available under every Clojure / JVM combination."
   (:require [clojure.instant]
             [fipp.ednize :refer [IEdn format-hack]])
-  (:import (java.sql Timestamp)
+  #_(:import (java.sql Timestamp)
            (java.util Date)))

-(extend-protocol IEdn
+#_(extend-protocol IEdn
   Timestamp
   (-edn [x]
     (let [s (format-hack #'clojure.instant/thread-local-utc-timestamp-format x)]

Puget diff:

diff --git a/src/puget/printer.clj b/src/puget/printer.clj
index b722902..a96d620 100644
--- a/src/puget/printer.clj
+++ b/src/puget/printer.clj
@@ -298,7 +298,7 @@
    java.util.Date
    (tagged-handler
      'inst
-     #(-> "yyyy-MM-dd'T'HH:mm:ss.SSS-00:00"
+     identity #_#(-> "yyyy-MM-dd'T'HH:mm:ss.SSS-00:00"
           (java.text.SimpleDateFormat.)
           (doto (.setTimeZone (java.util.TimeZone/getTimeZone "GMT")))
           (.format ^java.util.Date %)))
@borkdude
Copy link
Collaborator Author

It's not going to work unless bb includes rrb-vector (or some shim) or someone maintains a fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant