Re: bit-wise operators for bigint in Clojure

2020-06-02 Thread Niels van Klaveren
Clojure often leaves implementations to the backing platforms, and 
Clojurescript probably has no difference in the methods of the different 
numerical types.
Java does, so you'd have to fall back on that. Something like:

(defn big-or
  [f & r]
  (reduce (fn [acc v] (.or acc (biginteger v))) (biginteger f) r))

(defn big-and
  [f & r]
  (reduce (fn [acc v] (.and acc (biginteger v))) (biginteger f) r))

(defn big-xor
  [f & r]
  (reduce (fn [acc v] (.xor acc (biginteger v))) (biginteger f) r))

A lot of (mathemathical) operations need falling back to the platform, and 
this is by design for clojure. There are however libraries that are 
intended to abstract away the differences, and one of those for math is 
clojure.math.numeric-tower.

A numeric type independent implementation for bitwise operations would be a 
fitting pull request there.


On Tuesday, May 26, 2020 at 6:39:51 PM UTC+2, Harmon Nine wrote:
>
> Hello.
>
> I noticed a post about this from 2013, so doing a bump.
>
> The bit-wise operators appear to be supported for 'bigint' in 
> ClojureScript, but not in Clojure.  Is support for these operations on 
> 'bigint' in Clojure a future enhancement?
>
> Thanks :)
> -- Harmon
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/e8fe6493-4458-4a60-b9f5-902dbc2abf07%40googlegroups.com.


Re: bit-wise operators for bigint in Clojure

2020-06-02 Thread Niels van Klaveren
Clojure 1.10:

(and 4N 8N (bigint Integer/MAX_VALUE))
=> 2147483647N

(or 4N 8N (bigint Integer/MAX_VALUE))
=> 4N


On Tuesday, May 26, 2020 at 6:39:51 PM UTC+2, Harmon Nine wrote:
>
> Hello.
>
> I noticed a post about this from 2013, so doing a bump.
>
> The bit-wise operators appear to be supported for 'bigint' in 
> ClojureScript, but not in Clojure.  Is support for these operations on 
> 'bigint' in Clojure a future enhancement?
>
> Thanks :)
> -- Harmon
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/746ef4a0-84e4-4372-af98-3bb22bbb44c8%40googlegroups.com.


[ANN] re-graph 0.1.13 - the GraphQL client for Clojure/script

2020-06-02 Thread Oliver Hine
Hi everyone,

I'm pleased to announce the release of re-graph 0.1.13 
. re-graph is a GraphQL client for 
Clojurescript and Clojure with re-frame bindings and support for queries, 
subscriptions and mutations over websocket or HTTP.

Many thanks to @loomis  for implementing the 
vast majority of the features in this release.

This release *changes*:

   - Running on JDK 10 or lower will require the original Clojure 
   implementation based on clj-http and gniazdo. See the README 
   for details
   - The options supplied in init have been reorganised to separate 
   websocket and http parameters as follows:

*Previously:*

(re-frame/dispatch
  [::re-graph/init
{:ws-url "wss://foo.io/graphql-ws"
 :connection-init-payload {}
 :http-url "http://bar.io/graphql"}])

*Now:*

(re-frame/dispatch
  [::re-graph/init
{:ws {:url "wss://foo.io/graphql-ws"
 :connection-init-payload {}}
 :http {:url "http://bar.io/graphql"}}])

See the README for all option parameters.

This release *adds support for*:

   - Finer control over the http and websocket connections (:impl option) 
   e.g. sharing a cookie store as per #58 
   

This release *improves*:

   - Fewer dependencies on the JVM


It's available now on Clojars.

Thanks and enjoy,
Oliy

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/3d7e530e-40ed-4909-ab0d-a03d4e8a8384%40googlegroups.com.