[ANN] clamda - reducible Java Streams

2018-08-08 Thread dimitris

Hi folks,

/clamda/ [1], is a little library for working with Java Streams from 
Clojure, and to a lesser extend, for working with Clojure seqs from 
Java. Parallel streams are fully supported, but there are some gotchas 
(described in the README). Convenience helper for constructing Lamdas 
on-demand from plain Clojure functions, exists as well.


This library was motivated by the memory-mapped parallel stream returned 
by `Files.lines()` in JDK9. We can now take /full/ advantage of it (and 
other Streams like it) from Clojure.


Enjoy & feedback is always welcome ;)

Kind regards,

Dimitris

[1]: https://github.com/jimpil/clamda

--
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/d/optout.


Re: [ANN] clamda - reducible Java Streams

2018-08-08 Thread dimitris
Ignore my previous post please - I will try to get clamda 0.1.2 removed 
from clojars as it is misspelled (:facepalm:). There will be a new email 
eventually. Apologies for the noise...


Kind regards,

Dimitris


On 08/08/18 22:01, dimitris wrote:


Hi folks,

/clamda/ [1], is a little library for working with Java Streams from 
Clojure, and to a lesser extend, for working with Clojure seqs from 
Java. Parallel streams are fully supported, but there are some gotchas 
(described in the README). Convenience helper for constructing Lamdas 
on-demand from plain Clojure functions, exists as well.


This library was motivated by the memory-mapped parallel stream 
returned by `Files.lines()` in JDK9. We can now take /full/ advantage 
of it (and other Streams like it) from Clojure.


Enjoy & feedback is always welcome ;)

Kind regards,

Dimitris

[1]: https://github.com/jimpil/clamda



--
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/d/optout.


Re: How to escape a space in a keyword?

2018-08-08 Thread Didier
Reviving an old thread. I have a case where I convert ION to Clojure, and 
ION has a SYMBOL type, which can be any UTF-8 character, including spaces. 
I though of making them keywords in Clojure, since they serve the same 
purpose, to be used as identifiers. I can create such keyword with the 
keyword function, but they don't serialize to EDN and back using the 
default printer and reader.

I'm thinking of extending the printer like tbc++ says so keywords are 
printed as (keyword "string") instead. Does anyone believe there is 
something that's going to bite me later if I do this?

On Tuesday, 13 March 2012 00:14:48 UTC-7, Andy Fingerhut wrote:
>
> Ah, my senior moment was not noticing the invalid example use of symbol in 
> the second example, which was passing strings of decimal digits to symbol. 
>  I went ahead and deleted that one.
>
> Thanks,
> Andy
>
> On Mar 13, 2012, at 12:04 AM, Andy Fingerhut wrote:
>
> Which one?
>
> (symbol 'foo)
>
> (symbol "foo")
>
> (symbol "clojure.core" "foo")
>
> I don't see it, but I'm probably having a senior moment.
>
> clojuredocs.org are editable to anyone willing to create a free account, 
> by the way.  I'm nobody special there.
>
> Andy
>
> On Mar 12, 2012, at 11:53 PM, Meikel Brandmeyer (kotarak) wrote:
>
> Hi,
>
> Am Dienstag, 13. März 2012 07:46:58 UTC+1 schrieb Andy Fingerhut:
>>
>>
>> http://clojuredocs.org/clojure_core/clojure.core/symbol
>>
>>
> And right below is an example of invalid usage.
>
> Sincerely
> Meikel
>  
>
> -- 
> 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=en
>
>
>
>

-- 
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/d/optout.


Can someone explains the difference between print-method and print-dup once and for all?

2018-08-08 Thread Didier
Can someone explains the difference between print-method and print-dup once 
and for all?

Regards

-- 
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/d/optout.


Re: How to escape a space in a keyword?

2018-08-08 Thread Andy Fingerhut
If you want to serialize the data to EDN and back, and print them out into
the EDN file as (keyword "arbitrary-char-sequence"), then using the normal
Clojure functions for reading the EDN data in will leave those expressions
as the lists (keyword "arbitrary-char-sequence").  Of course you could
write a simple function that walks the data structure looking for such
lists and replacing them with the corresponding keywords.  However, that
breaks round-tripability of the data if you ever have an occurrence of such
a list in your original data before printing it to EDN.  If you believe, or
can somehow ensure, that will never happen, seems workable to me.

Using a custom data-reader like #my.namespace/keyword
"arbitrary-char-sequence" with a globally unique namespace that you own
would be less susceptible to such aliasing problems.

Andy

On Wed, Aug 8, 2018 at 4:55 PM Didier  wrote:

> Reviving an old thread. I have a case where I convert ION to Clojure, and
> ION has a SYMBOL type, which can be any UTF-8 character, including spaces.
> I though of making them keywords in Clojure, since they serve the same
> purpose, to be used as identifiers. I can create such keyword with the
> keyword function, but they don't serialize to EDN and back using the
> default printer and reader.
>
> I'm thinking of extending the printer like tbc++ says so keywords are
> printed as (keyword "string") instead. Does anyone believe there is
> something that's going to bite me later if I do this?
>
> On Tuesday, 13 March 2012 00:14:48 UTC-7, Andy Fingerhut wrote:
>>
>> Ah, my senior moment was not noticing the invalid example use of symbol
>> in the second example, which was passing strings of decimal digits to
>> symbol.  I went ahead and deleted that one.
>>
>> Thanks,
>> Andy
>>
>> On Mar 13, 2012, at 12:04 AM, Andy Fingerhut wrote:
>>
>> Which one?
>>
>> (symbol 'foo)
>>
>> (symbol "foo")
>>
>> (symbol "clojure.core" "foo")
>>
>> I don't see it, but I'm probably having a senior moment.
>>
>> clojuredocs.org are editable to anyone willing to create a free account,
>> by the way.  I'm nobody special there.
>>
>> Andy
>>
>> On Mar 12, 2012, at 11:53 PM, Meikel Brandmeyer (kotarak) wrote:
>>
>> Hi,
>>
>> Am Dienstag, 13. März 2012 07:46:58 UTC+1 schrieb Andy Fingerhut:
>>>
>>>
>>> http://clojuredocs.org/clojure_core/clojure.core/symbol
>>>
>>>
>> And right below is an example of invalid usage.
>>
>> Sincerely
>> Meikel
>>
>>
>> --
>> 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=en
>>
>>
>>
>> --
> 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/d/optout.
>

-- 
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/d/optout.


Re: How to escape a space in a keyword?

2018-08-08 Thread Alex Miller
Why are you fighting so hard to make keywords with spaces? If you need things 
with spaces, use strings.

-- 
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/d/optout.


Can someone explains the difference between print-method and print-dup once and for all?

2018-08-08 Thread Alex Miller
This is glossing over some details, but print-method is for “human” printing 
(print, println). 

print-dup is for printing readable data (pr, prn).

Often these are the same. Strings are a good example where they aren’t.

-- 
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/d/optout.


[ANN] hystrix-dynamicvar -- Clojure dynamic var binding through hystrix command

2018-08-08 Thread Jiacai Liu
https://github.com/Netflix/Hystrix does its job quiet good.
However, its thread-style isolation makes dynamic var not work any more.
hystrix-dynamicvar to the rescue. More refer:
- https://github.com/jiacai2050/hystrix-dynamicvar
- https://github.com/Netflix/Hystrix/wiki/Plugins#concurrencystrategy

-- 
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/d/optout.


Re: How to escape a space in a keyword?

2018-08-08 Thread Didier
Thanks Andy, ya I actually realized this, I'm using a custom reader literal now 
instead.

> Why are you fighting so hard to make keywords with spaces? If you need things 
> with spaces, use strings.

Why have keywords at all then? What does a space add that somehow negates the 
premise of keywords?

I see keywords over strings give you interning, namespaces, and the semantic 
that this value serves as an identifier. What's wrong with having that and a 
space as well?

Also, to be more specific to my use case. If I convert ION symbols to Clojure 
strings, I've lost information, and can no longer convert back to the same ION.

I need to do ION -> EDN -> ION in a lossless way. Piggybacking on keywords 
seemed easiest. 

-- 
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/d/optout.


Can someone explains the difference between print-method and print-dup once and for all?

2018-08-08 Thread Didier
Thanks, but I think I need the details. It seems pr, prn and company default to 
using print-method, and print-method implementations check for *print-readably*.

So how exactly would print-dup differ?

I ask specifically in the context of serializing Clojure to EDN and back. Would 
it be best to do so with print-dup true and print-readably true? What would be 
the expected pr-str settings?

-- 
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/d/optout.


Re: How to escape a space in a keyword?

2018-08-08 Thread Erik Assum
I was wondering about the rationale for the unreadable keywords a while a ago. 

Weavejester pointed me to 
https://clojure.org/guides/faq#unreadable_keywords
and
https://dev.clojure.org/jira/browse/CLJ-2309

Erik. 
-- 
i farta

> 9. aug. 2018 kl. 06:48 skrev Didier :
> 
> Thanks Andy, ya I actually realized this, I'm using a custom reader literal 
> now instead.
> 
>> Why are you fighting so hard to make keywords with spaces? If you need 
>> things with spaces, use strings.
> 
> Why have keywords at all then? What does a space add that somehow negates the 
> premise of keywords?
> 
> I see keywords over strings give you interning, namespaces, and the semantic 
> that this value serves as an identifier. What's wrong with having that and a 
> space as well?
> 
> Also, to be more specific to my use case. If I convert ION symbols to Clojure 
> strings, I've lost information, and can no longer convert back to the same 
> ION.
> 
> I need to do ION -> EDN -> ION in a lossless way. Piggybacking on keywords 
> seemed easiest. 
> 
> -- 
> 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/d/optout.

-- 
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/d/optout.