Fork me on GitHub

@xcthulhu: I can't resist a good arithmetic bug


Okay I'm going to have to try to fix one now too. Google Closure doesn't handle UTF-8 properly, so every time I've tried to use it for taking SHA256 of unicode it's been borked.


Also I was curious how to speed up division, the way GMP does it is by divide and conquer reducing the problem to Möller-Granlund division:


(s/def ::basically-an-integer
  (s/or :exact integer?
        :inexact #(and (number? %)
                       (zero? (- (int %) %)))))
(s/def ::basically-a-positive-integer
  (s/and ::basically-an-integer pos?))

user> (s/conform ::basically-an-integer 1.0)
;; => [:inexact 1.0]
user> (s/conform ::basically-a-positive-integer 1.0)
;; => ClassCastException   [trace missing]
running into this error, I realize it’s because s/and passes along the conformed value. is there an alternative to s/or or s/and that doesn’t add/pass along conformed information? would rather not have to think about the conformed value of the earlier spec when the spec essentially means “it’s safe to call pos? on it"


@alexmiller: realizing that there hasn't been an alpha release in nearly a month makes me wonder: would you say that spec has pretty much stabilized at this point? Not that I'm requesting any sort of commitment to that, of course; just curious what your sense is.

Alex Miller (Clojure team)16:08:59

Rich has just been busy/ooo

Alex Miller (Clojure team)16:08:12

We have a ton of stuff queued up :)


Makes sense, thanks! Looking forward to checking it out 😄

Alex Miller (Clojure team)16:08:33

@calvis Rich has suggested having both a flowing and non-flowing version of and and I think it’s likely that will eventually happen (probably and-> for flowing and and for non-flowing, although that changes the current meaning of and)


@alexmiller: yeah, that would be helpful. can’t really keep track which of my specs are or’s and which aren't

Alex Miller (Clojure team)16:08:44

one option here is to use s/conformer in ::basically-a-positive-integer to unwrap

Alex Miller (Clojure team)16:08:26

(s/def ::basically-a-positive-integer (s/and ::basically-an-integer (s/conformer val) pos?))