Re: Regarding http://clojuredocs.org

2013-10-10 Thread binita
Yes , agree with puzzler . 
Also the Search feature at http://clojuredocs.org is awesome. Personally, 
as a newbie , I find it very helpful, to be able to search and see the 
examples.

I didn't find the same at http://clojure.org/documentation, 
http://clojure.github.io/clojure or at http://clojure-doc.org though.

Thanks

On Thursday, October 10, 2013 8:14:40 AM UTC+5:30, puzzler wrote:

 On Tue, Oct 8, 2013 at 9:55 PM, Bruce Wang br...@brucewang.netjavascript:
  wrote:

 The official docs is at http://clojure.org/documentation, 
 http://clojure.github.io/clojure/ 



 Sure, but the nice thing about clojuredocs is that it includes examples 
 for most of the functions and for a while, it was updated more frequently 
 than the regular documentation site.  

 For example, I noticed the other day that in the main documentation site, 
 in the java interop section, there isn't much discussion about the 
 possibility of annotating functions of up to four arguments with primitive 
 types.  The fib example still shows the old way of handling primitives.  
 Where is one to learn these details?  Similarly, I noticed that the only 
 documentation about reducers is still a link to the original blog posts 
 which outline the idea, but are by no means thorough.  It would be great to 
 get back to having an active documentation repository for community 
 contributions.
  

-- 
-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


what does defserverfn mean?

2013-10-10 Thread Waldstein Wang
Hi all,
I am a newbie of Clojure and I am reading the source code of Twitter Storm, 
which has its major functions implemented by Clojure. I find following code:
(defserverfn service-handler [conf inimbus]
  (.prepare inimbus conf (master-inimbus-dir conf))
  (log-message Starting Nimbus with conf  conf)

But I did not find any related information of defserverfn in books or 
documents.
Can anybody tell me why no books mention this keyword?
Thx.

-- 
-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: what does defserverfn mean?

2013-10-10 Thread Chris Ford
Hi,

Clojure allows the creation of macros, which means that developers can
define new things that look like the keywords from other languages.

For example, even defn is just a macro that builds on top of the underlying
def and fn forms.

I expect that the Twitter storm team have a macro called defserverfn
defined somewhere in their codebase - don't expect to find it in Clojure
documentation or books because it's not part of the core language.

Cheers,

Chris


On 10 October 2013 09:36, Waldstein Wang bhwang2...@gmail.com wrote:

 Hi all,
 I am a newbie of Clojure and I am reading the source code of Twitter
 Storm, which has its major functions implemented by Clojure. I find
 following code:
 (defserverfn service-handler [conf inimbus]
   (.prepare inimbus conf (master-inimbus-dir conf))
   (log-message Starting Nimbus with conf  conf)

 But I did not find any related information of defserverfn in books or
 documents.
 Can anybody tell me why no books mention this keyword?
 Thx.

 --
 --
 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.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Regarding http://clojuredocs.org

2013-10-10 Thread Stefan du Fresne
Agree. I find the examples on clojuredocs really helpful (I find the 
official documentation often near-impenetrable), but it's super confusing 
how it references a bunch of old things.

On Thursday, 10 October 2013 20:20:58 UTC+13, binita wrote:

 Yes , agree with puzzler . 
 Also the Search feature at http://clojuredocs.org is awesome. Personally, 
 as a newbie , I find it very helpful, to be able to search and see the 
 examples.

 I didn't find the same at http://clojure.org/documentation, 
 http://clojure.github.io/clojure or at http://clojure-doc.org though.

 Thanks

 On Thursday, October 10, 2013 8:14:40 AM UTC+5:30, puzzler wrote:

 On Tue, Oct 8, 2013 at 9:55 PM, Bruce Wang br...@brucewang.net wrote:

 The official docs is at http://clojure.org/documentation, 
 http://clojure.github.io/clojure/ 



 Sure, but the nice thing about clojuredocs is that it includes examples 
 for most of the functions and for a while, it was updated more frequently 
 than the regular documentation site.  

 For example, I noticed the other day that in the main documentation site, 
 in the java interop section, there isn't much discussion about the 
 possibility of annotating functions of up to four arguments with primitive 
 types.  The fib example still shows the old way of handling primitives.  
 Where is one to learn these details?  Similarly, I noticed that the only 
 documentation about reducers is still a link to the original blog posts 
 which outline the idea, but are by no means thorough.  It would be great to 
 get back to having an active documentation repository for community 
 contributions.
  


-- 
-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Type annonations in clojure.instant/print-date result in speedup of 3

2013-10-10 Thread Alexander Kiel
Thanks Andy. I added a comment to 
http://dev.clojure.org/jira/browse/CLJ-1277

Am Donnerstag, 10. Oktober 2013 07:12:47 UTC+2 schrieb Andy Fingerhut:

 Thanks for checking, Alexander.  I have created ticket CLJ-1277 with a 
 patch that improves the performance of the case you found, as well as for 
 java.sql.Timestamp printing that also had reflection in it nearly identical 
 to what you found.

 http://dev.clojure.org/jira/browse/CLJ-1277

 Feel free to create an account on JIRA and vote for it, if you want to 
 help draw attention to it:

 http://dev.clojure.org/jira/secure/Signup!default.jspa

 You can also click the Watch link (after logging in) if you want to be 
 emailed of updates to the ticket's status.  I can make no promises on when 
 or if that might happen.

 Andy


 On Wed, Oct 9, 2013 at 10:47 AM, Alexander Kiel 
 alexan...@gmx.netjavascript:
  wrote:

 Hi Andy,

 http://dev.clojure.org/jira/browse/CLJ-1080 has not the same type hints 
 as I propose. You can see my patch here:

 https://github.com/alexanderkiel/clojure/compare/instant-type-hints

 I have an additional type hint at thread-local-utc-date-format and I use 
 java.text.DateFormat instead of java.text.SimpleDateFormat at utc-format.

 Alex

 Am Mittwoch, 9. Oktober 2013 18:49:32 UTC+2 schrieb Andy Fingerhut:

 Could you take a look at the patch on ticket CLJ-1080 and see if it 
 contains all of the improvements you mention?  Let me know if it doesn't, 
 and we can look at combining your improvements into that patch.

 
 http://dev.clojure.org/jira/**browse/CLJ-1080http://dev.clojure.org/jira/browse/CLJ-1080

 Andy


 On Wed, Oct 9, 2013 at 8:57 AM, Alexander Kiel alexan...@gmx.netwrote:

 Hi,

 I have a web service returning edn representations containing many 
 java.util.Date values. Using a profiler, one Hot Spot is inside the 
 clojure.instant/print-date function. The relevant reflections warnings are:

 Reflection warning, 
 instant.cljhttps://github.com/clojure/clojure/blob/master/src/clj/clojure/instant.clj:172:20
  
 - reference to field get can't be resolved.
 Reflection warning, instant.clj:174:15 - call to format can't be 
 resolved.
 Reflection warning, instant.clj:174:5 - call to write can't be 
 resolved.

 Adding a ^ThreadLocal annotation to thread-local-utc-date-**format and 
 a ^java.text.DateFormat to utc-format resolves all reflection warnings.

 I tested the speedup with 

 (time (let [d (java.util.Date.)] (doseq [_ (range 10)] (pr-str 
 d

 which takes about 1500 ms without the type annotations and about 500 ms 
 with type annotations.

 A single web service access is speeded up from about 350 ms to 250 ms. 
 The response contains about 3000 java.util.Date values.

 I could create a pull request if that would help. But I like to discuss 
 the change first. I have no CA so I use Clojure instead of Clojure Dev.

 Alex

 -- 
 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@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+u...@**googlegroups.com

 For more options, visit this group at
 http://groups.google.com/**group/clojure?hl=enhttp://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+u...@**googlegroups.com.

 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .


  -- 
 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.comjavascript:
 Note that posts from new members are moderated - please be patient with 
 your first post.
 To unsubscribe from this group, send email to
 clojure+u...@googlegroups.com javascript:
 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+u...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 

[ANN] Two Essays

2013-10-10 Thread Timothy Washington
Hey All,


I've been working on a few essays for a while now. But I wanted to release
these two initial ones for public consumption (citations pending). All
criticism and feedback is welcome. I'm eager to keep all of our tools and
skill set at the cutting edge, and hope this can benefit developers and the
community in general.


*A)* Computation And The Mind http://bit.ly/1c4I6nG is only tangentially
related to Clojure. I think though, that this is a good forum to get
constructive criticism, as it addresses the mindsets needed when thinking
about data, information, and the nature of computation.

*B)* I do want to remain grounded though. So there's also A Developer's
Toolbox http://bit.ly/154a6U0, which explores a good set of tools for
Web-Based and Rich Internet Applications.


Cheers

Tim Washington
Interruptsoftware.ca / Bkeeping.com

-- 
-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


core.match on a set

2013-10-10 Thread Phillip Lord

I've been playing with core.match recently. One thing that I am confused
about is, I cannot match over a set (based on membership), unless I
convert into a map first. 

So, for example

(defn map-set [set]
  (into {}
(for [k set]
  [k k])))

(let [x (map-set #{:a :b :c})]
  (match
   [x]
   [{:a _ :b _}] 'match_a_b
   :else nil))


returns 'match_a_b

Both of these...

(let [y #{:a :b :c}]
  (match
   [y]
   [{:a _ :b _}] 'match_a_b
   :else nil))

(let [z #{:a :b :c}]
  (match
   [z]
   [#{:a :b}] 'match_a_b
   :else nil))

returns nil. Am I missing something obvious?

Phil

-- 
-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Question about vector-of

2013-10-10 Thread David Nolen
Not that I'm aware of.

On Thursday, October 10, 2013, Mark Engelberg wrote:

 (def a (conj (vector-of :long) 1 2 3)
 (inc (a 1))

 Is Clojure smart enough to figure out that (a 1) is a primitive long and
 call the fast primitive version of inc?

 --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to 
 clojure@googlegroups.comjavascript:_e({}, 'cvml', 
 '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 javascript:_e({}, 'cvml',
 'clojure%2bunsubscr...@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 javascript:_e({}, 'cvml',
 'clojure%2bunsubscr...@googlegroups.com');.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: core.match on a set

2013-10-10 Thread David Nolen
There's currently no support for matching sets and I have no plans in the
near future. Patch welcome, it could be matched and optimized similarly to
map matching.

On Thursday, October 10, 2013, Phillip Lord wrote:


 I've been playing with core.match recently. One thing that I am confused
 about is, I cannot match over a set (based on membership), unless I
 convert into a map first.

 So, for example

 (defn map-set [set]
   (into {}
 (for [k set]
   [k k])))

 (let [x (map-set #{:a :b :c})]
   (match
[x]
[{:a _ :b _}] 'match_a_b
:else nil))


 returns 'match_a_b

 Both of these...

 (let [y #{:a :b :c}]
   (match
[y]
[{:a _ :b _}] 'match_a_b
:else nil))

 (let [z #{:a :b :c}]
   (match
[z]
[#{:a :b}] 'match_a_b
:else nil))

 returns nil. Am I missing something obvious?

 Phil

 --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.comjavascript:;
 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 javascript:;
 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 javascript:;.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ANN Introducing Machine Head, a Clojure MQTT client

2013-10-10 Thread Mikera
Hi Michael,

This looks great - many thanks for sharing!

Do you have any views / recommendations on an MQTT server/broker usable 
from Clojure? Is that on the roadmap for Machine Head?

  Mike.

-- 
-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ANN Introducing Machine Head, a Clojure MQTT client

2013-10-10 Thread Thomas
Hi Mike,

You can use any of the brokers listed here: 
http://mqtt.org/wiki/doku.php/brokers

Mosquitto is a free GPL (?) based broker which I have used in the past, I 
have used RSMB as well. And they all should work with Machine Head as it 
uses the Eclipse Paho Java client so I think it is very unlikely to be a 
problem.

Thomas

On Thursday, October 10, 2013 1:21:45 PM UTC+1, Mikera wrote:

 Hi Michael,

 This looks great - many thanks for sharing!

 Do you have any views / recommendations on an MQTT server/broker usable 
 from Clojure? Is that on the roadmap for Machine Head?

   Mike.


-- 
-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


[ANN] Puny, a tiny layer for persisting Clojure maps into Redis hashes

2013-10-10 Thread ronen
Puny is a tiny layer for persisting Clojure maps into Redis hashes, it aims 
to reduce boilerplate and to enable end to end life cycle management of 
entities from validation to data migration and indexing.

It includes support for:

* Complete generated CRUD API.
* Automatic keys and id management (both generated and internal to the 
entity).
* Automatic Validation checks.
* Declaring indexes.
* Attaching persisted metadata like versioning etc..
* Defining interceptors on CRUD functions enabling support for security 
checks, automatic migration etc..

Puny is based on [carmin](https://github.com/ptaoussanis/carmine), a big 
thank you to Peter its author.

For more info please visit: https://github.com/narkisr/puny

-- 
-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


[ANN] Counterclockwise - Clojure plugin for Eclipse

2013-10-10 Thread Laurent PETIT
Hi, a new version of Counterclockwise, the Clojure plugin for the
Eclipse IDE, has just been released.

Hot new features

- auto indentation as you type
- available as a Standalone Product: Download, Unzip, Code!
- many bug fixes including (hopefully) stability improvements

Install
=
- Software update site for installing into an existing Eclipse:
http://updatesite.ccw-ide.org/stable/

Standalone product for:
- Windows 64 bits:
http://updatesite.ccw-ide.org/branch/master/master-0.20.0.STABLE001/products/ccw-win32.win32.x86_64.zip
- Windows 32 bits:
http://updatesite.ccw-ide.org/branch/master/master-0.20.0.STABLE001/products/ccw-win32.win32.x86.zip
- Linux 64 bits:
http://updatesite.ccw-ide.org/branch/master/master-0.20.0.STABLE001/products/ccw-linux.gtk.x86_64.zip
- Linux 32 bits:
http://updatesite.ccw-ide.org/branch/master/master-0.20.0.STABLE001/products/ccw-linux.gtk.x86.zip
- OS X 64 bits:
http://updatesite.ccw-ide.org/branch/master/master-0.20.0.STABLE001/products/ccw-macosx.cocoa.x86_64.zip

Create a folder, unzip the product inside this folder, and double
click on the Counterclockwise executable! (only pre-requisite: Java
7 in your path)

Release Note
==
https://code.google.com/p/counterclockwise/wiki/ReleaseNotes#Version_0.20.0


Cheers,


--
Laurent Petit

-- 
-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Question about vector-of

2013-10-10 Thread Mark Engelberg
So do you just do:
(inc (long (a 1))), i.e., manually converting to long primitive?  Is there
much overhead for that call, if it is already a primitive?

To the best of my knowledge, you can't do:
(let [^long x (a 1)] (inc x))
because I think primitive type hints only work in function headers.  Is
that correct?

Thanks,

Mark




On Thu, Oct 10, 2013 at 5:09 AM, David Nolen dnolen.li...@gmail.com wrote:

 Not that I'm aware of.


 On Thursday, October 10, 2013, Mark Engelberg wrote:

 (def a (conj (vector-of :long) 1 2 3)
 (inc (a 1))

 Is Clojure smart enough to figure out that (a 1) is a primitive long and
 call the fast primitive version of inc?

 --
 --
 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.
 For more options, visit https://groups.google.com/groups/opt_out.

  --
 --
 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.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Question about vector-of

2013-10-10 Thread David Nolen
(a 1) will return a boxed value and (long (a 1)) will just cast it back to
a primitive. There is currently no way to efficiently deal with the
contents of gvecs. Their inclusion at this point is mostly about saving
memory.

In theory reducers could allow a primitive fn to do efficient work inside.

As far as getting a particular element without boxing, I don't see a way to
do that without implementing some interface like nthLong, nthDouble etc.
Maybe invokeDynamic could help here in the future?

David


On Thu, Oct 10, 2013 at 11:38 AM, Mark Engelberg
mark.engelb...@gmail.comwrote:

 So do you just do:
 (inc (long (a 1))), i.e., manually converting to long primitive?  Is there
 much overhead for that call, if it is already a primitive?

 To the best of my knowledge, you can't do:
 (let [^long x (a 1)] (inc x))
 because I think primitive type hints only work in function headers.  Is
 that correct?

 Thanks,

 Mark





 On Thu, Oct 10, 2013 at 5:09 AM, David Nolen dnolen.li...@gmail.comwrote:

 Not that I'm aware of.


 On Thursday, October 10, 2013, Mark Engelberg wrote:

 (def a (conj (vector-of :long) 1 2 3)
 (inc (a 1))

 Is Clojure smart enough to figure out that (a 1) is a primitive long and
 call the fast primitive version of inc?

 --
 --
 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.
 For more options, visit https://groups.google.com/groups/opt_out.

  --
 --
 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.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 --
 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.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Question about vector-of

2013-10-10 Thread David Nolen
(a 1) will return a boxed value and (long (a 1)) will just cast it back to
a primitive. There is currently no way to efficiently deal with the
contents of gvecs. Their inclusion at this point is mostly about saving
memory.

In theory reducers could allow a primitive fn to do efficient work inside.

As far as getting a particular element without boxing, I don't see a way to
do that without implementing some interface that supports nthLong,
nthDouble etc.

David


On Thu, Oct 10, 2013 at 11:38 AM, Mark Engelberg
mark.engelb...@gmail.comwrote:

 So do you just do:
 (inc (long (a 1))), i.e., manually converting to long primitive?  Is there
 much overhead for that call, if it is already a primitive?

 To the best of my knowledge, you can't do:
 (let [^long x (a 1)] (inc x))
 because I think primitive type hints only work in function headers.  Is
 that correct?

 Thanks,

 Mark





 On Thu, Oct 10, 2013 at 5:09 AM, David Nolen dnolen.li...@gmail.comwrote:

 Not that I'm aware of.


 On Thursday, October 10, 2013, Mark Engelberg wrote:

 (def a (conj (vector-of :long) 1 2 3)
 (inc (a 1))

 Is Clojure smart enough to figure out that (a 1) is a primitive long and
 call the fast primitive version of inc?

 --
 --
 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.
 For more options, visit https://groups.google.com/groups/opt_out.

  --
 --
 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.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 --
 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.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Clojure - Where to start?

2013-10-10 Thread Anurag Ramdasan
Hi,

I have a good understanding on Common Lisp and I've worked on it a lot.
I also have worked on Clojure a bit, very little actually, using emacs and 
nrepl.

I am now looking for something intermediate level resources on Clojure. 
Mostly stuffs that
deal with idiomatic clojures, clojure monads, lazy sequences etc. Can 
someone point me to
such resources on the internet that could get me writing some proper 
clojure? I'd really appreciate that.

Thanks,
Anurag.

-- 
-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Clojure - Where to start?

2013-10-10 Thread Michael Klishin
2013/10/11 Anurag Ramdasan aranurag...@gmail.com


 I am now looking for something intermediate level resources on Clojure.
 Mostly stuffs that
 deal with idiomatic clojures, clojure monads, lazy sequences etc.


http://clojure-doc.org can cover some of your needs, although it does not
cover monads.


 Can someone point me to
 such resources on the internet that could get me writing some proper
 clojure?


Read source code of popular open source projects. There is certainly more
than one
proper way to program in a Lisp dialect ;)
-- 
MK

http://github.com/michaelklishin
http://twitter.com/michaelklishin

-- 
-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


JVM assertions in Clojure

2013-10-10 Thread lopusz
Dear All,

Is it possible to use Java assertion system in Clojure?

I want to put invariant checks in my code which can be turned on/off at
runtime with java -ea/-da.

http://docs.oracle.com/javase/7/docs/technotes/guides/language/assert.html

The only mention touching this issue in Clojure I could find is

https://groups.google.com/forum/#!topic/clojure-dev/kUCVUEALmWI

it does not give any constructive suggestions, though.

Has anybody used this JVM facility in Clojure code?

Thanks in advance for any of your hints!

Best regards,
Michal

-- 
-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] Counterclockwise - Clojure plugin for Eclipse

2013-10-10 Thread Mark C
Nice update, I like auto-indent.

I ran into one small glitch on OSX, which is that the shortcut for toggling 
between unrestricted and strict/paredit mode wasn't working for me at first.
Going to Preferences - General - Keys : Switch Edit mode, and deleting 
then re-applying the Alt-D fixed it.  Just in case anyone else runs into 
that.

M.

On Thursday, October 10, 2013 9:36:01 AM UTC-4, Laurent PETIT wrote:

 Hi, a new version of Counterclockwise, the Clojure plugin for the 
 Eclipse IDE, has just been released. 

 Hot new features 
  
 - auto indentation as you type 
 - available as a Standalone Product: Download, Unzip, Code! 
 - many bug fixes including (hopefully) stability improvements 

 Install 
 = 
 - Software update site for installing into an existing Eclipse: 
 http://updatesite.ccw-ide.org/stable/ 

 Standalone product for: 
 - Windows 64 bits: 

 http://updatesite.ccw-ide.org/branch/master/master-0.20.0.STABLE001/products/ccw-win32.win32.x86_64.zip
  
 - Windows 32 bits: 

 http://updatesite.ccw-ide.org/branch/master/master-0.20.0.STABLE001/products/ccw-win32.win32.x86.zip
  
 - Linux 64 bits: 

 http://updatesite.ccw-ide.org/branch/master/master-0.20.0.STABLE001/products/ccw-linux.gtk.x86_64.zip
  
 - Linux 32 bits: 

 http://updatesite.ccw-ide.org/branch/master/master-0.20.0.STABLE001/products/ccw-linux.gtk.x86.zip
  
 - OS X 64 bits: 

 http://updatesite.ccw-ide.org/branch/master/master-0.20.0.STABLE001/products/ccw-macosx.cocoa.x86_64.zip
  

 Create a folder, unzip the product inside this folder, and double 
 click on the Counterclockwise executable! (only pre-requisite: Java 
 7 in your path) 

 Release Note 
 == 
 https://code.google.com/p/counterclockwise/wiki/ReleaseNotes#Version_0.20.0 


 Cheers, 


 -- 
 Laurent Petit 


-- 
-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] Counterclockwise - Clojure plugin for Eclipse

2013-10-10 Thread Laurent PETIT
2013/10/10 Mark C champi...@netscape.net:
 Nice update, I like auto-indent.

 I ran into one small glitch on OSX, which is that the shortcut for toggling
 between unrestricted and strict/paredit mode wasn't working for me at first.
 Going to Preferences - General - Keys : Switch Edit mode, and deleting
 then re-applying the Alt-D fixed it.  Just in case anyone else runs into
 that.

Weird

-- 
-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Clojure - Where to start?

2013-10-10 Thread Jeff Heon
I remember reading a post with a list of open source projects with excellent 
clojure code.

Unfortunately, I can't find it anymore, but I remember Ring was on the list.

-- 
-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: clojars.org image for latest version of a project

2013-10-10 Thread Adam Clements
Is there any chance we could get a route which simply returns this as plain
text? I have an emacs plugin which looks up the latest version of an
artifact on clojars (currently using some horrible regex)
https://github.com/AdamClements/latest-clojure-libraries which would be
much much nicer if it was using a supported api! I find it ridiculously
useful not having to go to my browser to look up the latest version of
libraries I use all the time.

Adam


Adam Clements

+44 7947 724 795
--
This email and any files transmitted with it are confidential. If you are
not the intended recipient, you are hereby notified that any disclosure,
distribution or copying of this communication is strictly prohibited.


On Mon, Oct 7, 2013 at 7:59 PM, Nelson Morris nmor...@nelsonmorris.netwrote:

 There is a new route on clojars.org that will create an svg of the lein
 coordinates for the latest version of a project. To use it add
 /latest-version.svg to a project url. An example can be found at
 https://clojars.org/compojure/latest-version.svg. This may be useful for
 a project readme.

 Many thanks to Alexander Yakushev (https://github.com/alexander-yakushev)
 for putting together the commit.

 -
 Nelson Morris

 --
 --
 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.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: clojars.org image for latest version of a project

2013-10-10 Thread Karsten Schmidt
On 11 October 2013 00:01, Adam Clements adam.cleme...@gmail.com wrote:
 I find it ridiculously useful not having to go to my browser to look up the
 latest version of libraries I use all the time.

Adam, you might want to check out this leiningen plugin then...
https://github.com/xsc/lein-ancient

K.

-- 
-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] Counterclockwise - Clojure plugin for Eclipse

2013-10-10 Thread Russell Mull


 - available as a Standalone Product: Download, Unzip, Code! 


This is huge! Maybe it seems like a trivial thing, but removing barriers to 
getting started is fantastic. 

Thank you Laurent, for your tireless and continuing work. 

- Russell

-- 
-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: clojars.org image for latest version of a project

2013-10-10 Thread Mark Mandel
Thanks for that recommendation! I was thinking about this exactly this
issue.

Mark


On Fri, Oct 11, 2013 at 10:19 AM, Karsten Schmidt i...@toxi.co.uk wrote:

 On 11 October 2013 00:01, Adam Clements adam.cleme...@gmail.com wrote:
  I find it ridiculously useful not having to go to my browser to look up
 the
  latest version of libraries I use all the time.

 Adam, you might want to check out this leiningen plugin then...
 https://github.com/xsc/lein-ancient

 K.

 --
 --
 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.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
E: mark.man...@gmail.com
T: http://www.twitter.com/neurotic
W: www.compoundtheory.com

2 Devs from Down Under Podcast
http://www.2ddu.com/

-- 
-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: streams, reading bytes

2013-10-10 Thread Brian Craft
I like the blurb:

This library is a Rosetta stone for all the byte representations Java has 
to offer, and gives you the freedom to forget all the APIs you never wanted 
to know in the first place.

My feelings, exactly. ;)

Thanks.

On Thursday, October 10, 2013 6:44:32 PM UTC-7, Ben Mabey wrote:

 On 10/10/13 7:21 PM, Brian Craft wrote: 
  I'm struggling with how to gzip/gunzip byte arrays from clojure. I 
  don't really get how clojure.java.io streams supposed to be used. 
  
  This appears to gzip a string: 
  
  (let [baos (java.io.ByteArrayOutputStream.) 
gzos (java.util.zip.GZIPOutputStream. baos)] 
  (.write gzos (.getBytes foo)) 
  (.finish gzos) 
  (.toByteArray baos)) 
  
  
  and I can expand on this to gunzip the string afterwards: 
  
  (let [baos (java.io.ByteArrayOutputStream.) 
gzos (java.util.zip.GZIPOutputStream. baos)] 
(.write gzos (.getBytes foo)) 
(.finish gzos) 
(let [gzbytes (.toByteArray baos) 
  bais (java.io.ByteArrayInputStream. gzbytes) 
  gzis (java.util.zip.GZIPInputStream. bais)] 
  (slurp gzis))) 
  
  But slurp builds strings. I need to do this with byte arrays.  Do I 
  have to rewrite slurp to build a byte array? Is there any simpler way 
  to do this? 

 Zach Tellman's byte-streams library is very handy for these kinds of 
 conversions: 

 https://github.com/ztellman/byte-streams 

 -Ben 



-- 
-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


monger read reference

2013-10-10 Thread Gary Zhao
Hello

Anyone knows if I can set read reference in monger? e.g. nearest. I 
didn't see it on their documentation.

Thanks
Gary

-- 
-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.