Re: ArithmeticException while using unchecked-multiply

2015-10-26 Thread Andy Fingerhut
While waiting to see what becomes of that ticket, if someone felt energetic
enough to document the gotchas with the unchecked functions, and recommend
how to get the desired results, e.g. either ^long type hints, or if (long
x) type conversions on the arguments work (I haven't checked), Reid
McKenzie's Grimoire updates can be made via pull request here:

https://github.com/clojure-grimoire/datastore

Or wiki edits can be made to ClojureDocs.org here:

http://clojuredocs.org/clojure.core/unchecked-multiply
http://clojuredocs.org/clojure.core/unchecked-add
http://clojuredocs.org/clojure.core/unchecked-subtract

Describing the odd behavior in only one of those entries, and then
cross-referencing it explicitly in the examples of the others to the
'detailed one', can save redundancy in writing.

Andy


On Sun, Oct 25, 2015 at 11:17 PM, Andy Fingerhut 
wrote:

> I created this ticket: http://dev.clojure.org/jira/browse/CLJ-1832
>
> I don't know what will become of it, e.g. perhaps a change in behavior to
> the unchecked functions, perhaps a clarification to the documentation,
> perhaps nothing.  I wouldn't be surprised if the Clojure core team judged
> the existing documentation strings to be explicit enough because they use
> little-L 'long', and it doesn't promise any behavior of any kind for
> arguments that are not 'long'.
>
> Feel free to add comments or edit the description if I've left anything
> out, vote on it, etc.
>
> Andy
>
> On Sun, Oct 25, 2015 at 5:50 PM, Gary Fredericks  > wrote:
>
>> Half of the time that I use the unchecked functions it's for the math,
>> not the speed, so getting the wrong behavior when I don't care enough about
>> perf to do the work for primitives is pretty annoying.
>>
>>
>> On Sunday, October 25, 2015 at 7:49:47 PM UTC-5, Gary Fredericks wrote:
>>>
>>> Maybe even not warn unless that one var where you can get
>>> boxed-math-warnings is set appropriately.
>>>
>>> On Sunday, October 25, 2015 at 2:04:36 PM UTC-5, Fluid Dynamics wrote:

 On Saturday, October 24, 2015 at 8:01:05 PM UTC-4, Gary Fredericks
 wrote:
>
> I've always thought this is bad behavior, since it's blatantly doing
> the opposite of what the name advertises. I think either the boxed 
> versions
> should return the same result as the unboxed version, or (if the whole
> point is to give good performance and so we don't want want users to be
> able to accidentally use the unboxed versions) it should throw at
> compile-time for boxed args.
>

 Or it could emit just a warning at compile-time, and give the same
 result at run-time as the unboxed version. Then you don't have to stop
 everything else you're doing and fix the boxed math first, when you might
 have higher priorities. The warnings will remind you to fix it eventually.

>>> --
>> 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: ArithmeticException while using unchecked-multiply

2015-10-26 Thread Andy Fingerhut
I created this ticket: http://dev.clojure.org/jira/browse/CLJ-1832

I don't know what will become of it, e.g. perhaps a change in behavior to
the unchecked functions, perhaps a clarification to the documentation,
perhaps nothing.  I wouldn't be surprised if the Clojure core team judged
the existing documentation strings to be explicit enough because they use
little-L 'long', and it doesn't promise any behavior of any kind for
arguments that are not 'long'.

Feel free to add comments or edit the description if I've left anything
out, vote on it, etc.

Andy

On Sun, Oct 25, 2015 at 5:50 PM, Gary Fredericks 
wrote:

> Half of the time that I use the unchecked functions it's for the math, not
> the speed, so getting the wrong behavior when I don't care enough about
> perf to do the work for primitives is pretty annoying.
>
>
> On Sunday, October 25, 2015 at 7:49:47 PM UTC-5, Gary Fredericks wrote:
>>
>> Maybe even not warn unless that one var where you can get
>> boxed-math-warnings is set appropriately.
>>
>> On Sunday, October 25, 2015 at 2:04:36 PM UTC-5, Fluid Dynamics wrote:
>>>
>>> On Saturday, October 24, 2015 at 8:01:05 PM UTC-4, Gary Fredericks wrote:

 I've always thought this is bad behavior, since it's blatantly doing
 the opposite of what the name advertises. I think either the boxed versions
 should return the same result as the unboxed version, or (if the whole
 point is to give good performance and so we don't want want users to be
 able to accidentally use the unboxed versions) it should throw at
 compile-time for boxed args.

>>>
>>> Or it could emit just a warning at compile-time, and give the same
>>> result at run-time as the unboxed version. Then you don't have to stop
>>> everything else you're doing and fix the boxed math first, when you might
>>> have higher priorities. The warnings will remind you to fix it eventually.
>>>
>> --
> 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.


how to speedup lein uberjar?

2015-10-26 Thread Sunil S Nandihalli
Hi Everybody,
  My lein uberjar takes about 2 minutes to run. It also recompiles all the
clj files everytime.  Is there a way to speedup lein-uberjar .. Or may be
make it incremental?
Thanks,
Sunil.

-- 
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: Examples of core.async usage in production?

2015-10-26 Thread Robin Heggelund Hansen
I have used core.async in production on the backend. Works great, but it 
does involve a bit more work, as you need to make sure that all io 
(database) and middleware supports core.async. But it works well. There are 
postgres.async for async db, and fink-nottle for sending sms/push 
notifications/email etc. using core.async.

mandag 26. oktober 2015 17.26.19 UTC+1 skrev juan.facorro følgende:
>
> Hi all,
>
> From what I've seen/heard/understand core.async has been mostly used in 
> production on the *client side* or UI programming, since it frees us from 
> the dreaded callback hell. There are some instances where *core.async* is 
> used on the *server side* to provide asynchronous communication between 
> client and server [1][2]; and I wonder how many are using those 
> libraries/features and how. 
>
> I'm sure there are a lot more libraries built on top of *core.async* to 
> be used on the server, but my question/survey is related to *how many of 
> those are used in production today*. I have also found some comments 
> about using Pulsar  as an 
> alternative for asynchronous message passing scenarios [3][4]. How many of 
> you have gone that way instead?
>
> Looking forward to your comments & replies.
>
> Cheers!
> Juan
>
> [1] https://github.com/ptaoussanis/sente
> [2] https://github.com/bguthrie/async-sockets
> [3] https://groups.google.com/d/msg/clojure/m6bqGd8vQZQ/hR5rxE4oHSMJ
> [4] 
> http://stackoverflow.com/questions/32299299/is-it-safe-to-use-clojure-core-async-in-production-even-though-its-alpha
>

-- 
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: compojure/http-kit redirection

2015-10-26 Thread James Reeves
On 26 October 2015 at 20:47, JvJ  wrote:

> I would like to have one request redirect to another page, but I'm not
> sure how:
>
> (defroutes app
>   (GET "/ws" ws-handler) ; Websocket connection
>   (GET "/user/:id" [id] ;; I want to redirect to index.html?user=id
>))
>
> When I get the /user/:id path, I would like to return index.html?user=id.
> How can that be done?
>

Return a HTTP redirect response. So for example, you could do:

  (GET "/user/:id" [id]
{:status 302
 :headers {"Location" (str "/index.html?user=" id)}
 :body nil})

For convenience, Ring has the ring.util.response/redirect function to make
this more concise:

  (GET "/user/:id" [id]
(redirect (str "/index.html?user=" id)))



> Also, how to I interpret URL params using defroutes?
>

The same way you interpret route parameters, but you'll need to add the
ring.middleware.params/wrap-params middleware to your handler.

- James

-- 
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: Processing futures and promises asynchronously

2015-10-26 Thread Leonardo Borges
Hi Daniel,

Since you're used to Scala futures, you might find this library easy to get
started with:

https://github.com/leonardoborges/imminent (A composable Futures library
for Clojure)

The next release will also include ClojureScript support.

Cheers,
Leonardo Borges
www.leonardoborges.com

On Tue, Oct 27, 2015 at 9:46 AM Daniel Hinojosa 
wrote:

> I am looking for a functional, non-blocking way to process the return of a
> future. In the Scala world, you can use map, flatMap, and foreach to
> process the return values of a future asynchronously.  In Clojure,
> dereferencing blocks, so that makes it kind of rough since we have to set
> up our constructs.  If anyone can steer me on the "Functional Clojure way"
> to process futures and promises that would be greatly appreciated. ;)
>
> --
> 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: [ANN] prismatic/schema 1.0 adds automatic test data generation

2015-10-26 Thread Jason Wolfe
Thanks!

Just fixed the warning, will go out with the next release.

-Jason


On Mon, Oct 26, 2015 at 5:44 PM, Jason Felice 
wrote:

> It works great.  All I did was updated project.clj, replaced s/both with
> s/constrained and removed the s/pred around the arguments, and it all
> worked.
>
> One little weird thing: It now complains:
> WARNING: atom already refers to: #'clojure.core/atom in namespace:
> schema.core, being replaced by: #'schema.core/atom
>
> But I can't figure out why, because schema.core is clearly excluding
> atom.  This project is on clojure 1.7.0.
>
> -Jason
>
>
> On Mon, Oct 26, 2015 at 11:58 AM, Jason Felice 
> wrote:
>
>> Thanks!
>>
>> I'll try it out this week and let you know.
>>
>> On Sun, Oct 25, 2015 at 8:28 PM, Jason Wolfe  wrote:
>>
>>> FYI -- we just released Schema 1.0.2, which adds `s/constrained` for
>>> postconditions.
>>>
>>> -Jason
>>>
>>> On Thursday, September 3, 2015 at 3:05:29 PM UTC-3, Jason Felice wrote:


 On Wed, Sep 2, 2015 at 9:56 PM, Jason Wolfe  wrote:
>
> Outside of that, I can still potentially see the desire to specify
> postconditions rather than preconditions (you'd rather see an error (not
> (integer? "1")) than (throws? (odd? "1")), which will be the behavior when
> the bug is fixed.  We're thinking about whether it's worth the extra
> complexity to support that, what are your thoughts?  If you think it would
> be valuable, please open another issue on github so we can track it --
> thanks.
>

 Postconditions are what I reached for intuitively, and so I suspect
 many other people will also try to figure them out.  It "feels good" if one
 is anticipating a generator and knows about gen/such-that, for example.

 I haven't looked at the Schema generation API yet, but I'd like to not
 need to specify leaf generators (except perhaps for performance reasons).

 That said, s/both is both (ha!) awkwardly named (since it can take more
 than two) and not a mechanism I'm attached to.  Perhaps there's another
 way?  I'd be happy if there is a concise, recommended, well-documented way,
 even if (like gen/bind) I have to jump through a few mental hoops to figure
 out how to phrase it.

 -Jason

>>> --
>>> 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 a topic in the
> Google Groups "Clojure" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/clojure/jfQ6vzg8pAE/unsubscribe.
> To unsubscribe from this group and all its topics, 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.


compojure/http-kit redirection

2015-10-26 Thread JvJ
Hi, I'm starting a web app with compojure and http-kit.  I would like to 
have one request redirect to another page, but I'm not sure how:

(defroutes app
  (GET "/ws" ws-handler) ; Websocket connection
  (GET "/user/:id" [id] ;; I want to redirect to index.html?user=id
   )
  (resources "/"))


When I get the /user/:id path, I would like to return index.html?user=id. 
 How can that be done?


Also, how to I interpret URL params using defroutes?


Thanks.

-- 
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: ArithmeticException while using unchecked-multiply

2015-10-26 Thread Gary Fredericks
Thanks andy!

On Monday, October 26, 2015 at 1:25:42 AM UTC-5, Andy Fingerhut wrote:
>
> While waiting to see what becomes of that ticket, if someone felt 
> energetic enough to document the gotchas with the unchecked functions, and 
> recommend how to get the desired results, e.g. either ^long type hints, or 
> if (long x) type conversions on the arguments work (I haven't checked), 
> Reid McKenzie's Grimoire updates can be made via pull request here:
>
> https://github.com/clojure-grimoire/datastore
>
> Or wiki edits can be made to ClojureDocs.org here:
>
> http://clojuredocs.org/clojure.core/unchecked-multiply
> http://clojuredocs.org/clojure.core/unchecked-add
> http://clojuredocs.org/clojure.core/unchecked-subtract
>
> Describing the odd behavior in only one of those entries, and then 
> cross-referencing it explicitly in the examples of the others to the 
> 'detailed one', can save redundancy in writing.
>
> Andy
>
>
> On Sun, Oct 25, 2015 at 11:17 PM, Andy Fingerhut  > wrote:
>
>> I created this ticket: http://dev.clojure.org/jira/browse/CLJ-1832
>>
>> I don't know what will become of it, e.g. perhaps a change in behavior to 
>> the unchecked functions, perhaps a clarification to the documentation, 
>> perhaps nothing.  I wouldn't be surprised if the Clojure core team judged 
>> the existing documentation strings to be explicit enough because they use 
>> little-L 'long', and it doesn't promise any behavior of any kind for 
>> arguments that are not 'long'.
>>
>> Feel free to add comments or edit the description if I've left anything 
>> out, vote on it, etc.
>>
>> Andy
>>
>> On Sun, Oct 25, 2015 at 5:50 PM, Gary Fredericks > > wrote:
>>
>>> Half of the time that I use the unchecked functions it's for the math, 
>>> not the speed, so getting the wrong behavior when I don't care enough about 
>>> perf to do the work for primitives is pretty annoying.
>>>
>>>
>>> On Sunday, October 25, 2015 at 7:49:47 PM UTC-5, Gary Fredericks wrote:

 Maybe even not warn unless that one var where you can get 
 boxed-math-warnings is set appropriately.

 On Sunday, October 25, 2015 at 2:04:36 PM UTC-5, Fluid Dynamics wrote:
>
> On Saturday, October 24, 2015 at 8:01:05 PM UTC-4, Gary Fredericks 
> wrote:
>>
>> I've always thought this is bad behavior, since it's blatantly doing 
>> the opposite of what the name advertises. I think either the boxed 
>> versions 
>> should return the same result as the unboxed version, or (if the whole 
>> point is to give good performance and so we don't want want users to be 
>> able to accidentally use the unboxed versions) it should throw at 
>> compile-time for boxed args.
>>
>
> Or it could emit just a warning at compile-time, and give the same 
> result at run-time as the unboxed version. Then you don't have to stop 
> everything else you're doing and fix the boxed math first, when you might 
> have higher priorities. The warnings will remind you to fix it 
> eventually. 
>
 -- 
>>> 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 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/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: Examples of core.async usage in production?

2015-10-26 Thread Moe Aboulkheir
I've used core.async in production a bunch with AWS.

On Mon, Oct 26, 2015 at 7:24 PM, Robin Heggelund Hansen
 wrote: There are
> postgres.async for async db, and fink-nottle for sending sms/push
> notifications/email etc. using core.async.

In addition to those services (i.e. RDS, SNS, SQS), there are
core.async-friendly libraries you can use with Redis/ElastiCache
(redis-async), Lambda & Dynamo.  So you shouldn't have to rewrite too
much bytecode if you're interested running on EC2.  I'm sure there are
plenty of alternatives for other environments.

Take care,
Moe

-- 
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] prismatic/schema 1.0 adds automatic test data generation

2015-10-26 Thread Jason Felice
It works great.  All I did was updated project.clj, replaced s/both with
s/constrained and removed the s/pred around the arguments, and it all
worked.

One little weird thing: It now complains:
WARNING: atom already refers to: #'clojure.core/atom in namespace:
schema.core, being replaced by: #'schema.core/atom

But I can't figure out why, because schema.core is clearly excluding atom.
This project is on clojure 1.7.0.

-Jason


On Mon, Oct 26, 2015 at 11:58 AM, Jason Felice 
wrote:

> Thanks!
>
> I'll try it out this week and let you know.
>
> On Sun, Oct 25, 2015 at 8:28 PM, Jason Wolfe  wrote:
>
>> FYI -- we just released Schema 1.0.2, which adds `s/constrained` for
>> postconditions.
>>
>> -Jason
>>
>> On Thursday, September 3, 2015 at 3:05:29 PM UTC-3, Jason Felice wrote:
>>>
>>>
>>> On Wed, Sep 2, 2015 at 9:56 PM, Jason Wolfe  wrote:

 Outside of that, I can still potentially see the desire to specify
 postconditions rather than preconditions (you'd rather see an error (not
 (integer? "1")) than (throws? (odd? "1")), which will be the behavior when
 the bug is fixed.  We're thinking about whether it's worth the extra
 complexity to support that, what are your thoughts?  If you think it would
 be valuable, please open another issue on github so we can track it --
 thanks.

>>>
>>> Postconditions are what I reached for intuitively, and so I suspect many
>>> other people will also try to figure them out.  It "feels good" if one is
>>> anticipating a generator and knows about gen/such-that, for example.
>>>
>>> I haven't looked at the Schema generation API yet, but I'd like to not
>>> need to specify leaf generators (except perhaps for performance reasons).
>>>
>>> That said, s/both is both (ha!) awkwardly named (since it can take more
>>> than two) and not a mechanism I'm attached to.  Perhaps there's another
>>> way?  I'd be happy if there is a concise, recommended, well-documented way,
>>> even if (like gen/bind) I have to jump through a few mental hoops to figure
>>> out how to phrase it.
>>>
>>> -Jason
>>>
>> --
>> 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: Need help setting up Emacs for Clojure on Windows 8

2015-10-26 Thread Tina Ramsey
That Reddit post did help, thanks. I have a HOME environment variable set 
up on Windows so I can use ~ anywhere, so that wasn't the problem, but when 
I opened my clojure project and ran M-x cider-jack-in it opened the repl. I 
guess the configs did run properly, even though I didn't get any 
indication? And I had no clue about cider-jack-in ... not sure how I was 
supposed to figure that out! Thanks for your help! Luckily I don't have to 
write that much Clojure on my work machine, because I'm really enjoying 
learning it but so far everything, including installing Clojure itself and 
Leiningen, has gone pretty rough for me on Windows.


On Monday, October 26, 2015 at 11:17:52 AM UTC-7, David Powell wrote:
>
>
> (There shouldn't actually be any problem using ~ from within emacs in 
> Windows though - emacs will automatically handle it - I do it all the 
> time.  It is probably related to emacs using 
> "C:\Users\jason\AppData\Roaming" as its home directory though.)
>
> On Mon, Oct 26, 2015 at 6:09 PM, Daniel Higginbotham  > wrote:
> >
> > Sorry you're having trouble! Does this help? 
> https://www.reddit.com/r/Clojure/comments/3pn3fo/clojure_for_the_brave_and_true_updated_to_match/cw8h8qy
> >
>

-- 
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: Processing futures and promises asynchronously

2015-10-26 Thread Matching Socks
See also: Zach Tellman's "Manifold"

http://aleph.io/manifold/rationale.html

http://aleph.io/manifold/deferreds.html


-- 
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: Processing futures and promises asynchronously

2015-10-26 Thread Chris Murphy


Here are some discussions around the issue:

http://stackoverflow.com/questions/31832599/future-failure-in-clojure

 ~ Chris

On 27/10/2015 9:46 AM, Daniel Hinojosa wrote:
I am looking for a functional, non-blocking way to process the return 
of a future. In the Scala world, you can use map, flatMap, and foreach 
to process the return values of a future asynchronously.  In Clojure, 
dereferencing blocks, so that makes it kind of rough since we have to 
set up our constructs.  If anyone can steer me on the "Functional 
Clojure way" to process futures and promises that would be greatly 
appreciated. ;)

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


Processing futures and promises asynchronously

2015-10-26 Thread Daniel Hinojosa
I am looking for a functional, non-blocking way to process the return of a 
future. In the Scala world, you can use map, flatMap, and foreach to 
process the return values of a future asynchronously.  In Clojure, 
dereferencing blocks, so that makes it kind of rough since we have to set 
up our constructs.  If anyone can steer me on the "Functional Clojure way" 
to process futures and promises that would be greatly appreciated. ;)

-- 
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: safety and reusability of clojure.lang.RT, Compiler and co. in multi-classloader environment

2015-10-26 Thread Georgi Danov
Just for the record, there is one more relevant thread 
https://groups.google.com/d/topic/clojure/0AgUIiY8BQ8/discussion

On Tuesday, September 29, 2015 at 12:08:16 AM UTC+2, Georgi Danov wrote:
>
> Hi,
>  I am integrating clojure into java micro container. It has hierarchical 
> classloaders and can restart modules on the fly. It's almost REPL for Java 
> :).
>
>  I have clojure running inside it, but even after reading some of the RT 
> and Compiler classes source code I don't understand well enough how much 
> state is accumulated where (theadLocals, static class fields/Vars, 
> classloader, so on). Given that I don't want to have each module run 
> different clojure version, I would prefer to have the basic things loaded 
> once and shared.
>
>  I am also not sure what is shareable — I see the RT class has some static 
> init functionality that appears to be safe for sharing the same clojure.jar 
> classloader with all modules, but can't be sure.
>  
>  Would be glad if there is article I have missed that outlines this. 
>
> Thanks,
> Georgi
>

-- 
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] prismatic/schema 1.0 adds automatic test data generation

2015-10-26 Thread Jason Felice
Thanks!

I'll try it out this week and let you know.

On Sun, Oct 25, 2015 at 8:28 PM, Jason Wolfe  wrote:

> FYI -- we just released Schema 1.0.2, which adds `s/constrained` for
> postconditions.
>
> -Jason
>
> On Thursday, September 3, 2015 at 3:05:29 PM UTC-3, Jason Felice wrote:
>>
>>
>> On Wed, Sep 2, 2015 at 9:56 PM, Jason Wolfe  wrote:
>>>
>>> Outside of that, I can still potentially see the desire to specify
>>> postconditions rather than preconditions (you'd rather see an error (not
>>> (integer? "1")) than (throws? (odd? "1")), which will be the behavior when
>>> the bug is fixed.  We're thinking about whether it's worth the extra
>>> complexity to support that, what are your thoughts?  If you think it would
>>> be valuable, please open another issue on github so we can track it --
>>> thanks.
>>>
>>
>> Postconditions are what I reached for intuitively, and so I suspect many
>> other people will also try to figure them out.  It "feels good" if one is
>> anticipating a generator and knows about gen/such-that, for example.
>>
>> I haven't looked at the Schema generation API yet, but I'd like to not
>> need to specify leaf generators (except perhaps for performance reasons).
>>
>> That said, s/both is both (ha!) awkwardly named (since it can take more
>> than two) and not a mechanism I'm attached to.  Perhaps there's another
>> way?  I'd be happy if there is a concise, recommended, well-documented way,
>> even if (like gen/bind) I have to jump through a few mental hoops to figure
>> out how to phrase it.
>>
>> -Jason
>>
> --
> 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.


New Functional Programming Job Opportunities

2015-10-26 Thread Functional Jobs
Here are some functional programming job opportunities that were posted

recently:



Clojure Engineer at Ride On Consulting

https://functionaljobs.com/jobs/8863-clojure-engineer-at-ride-on-consulting



Clojure Engineer at MixRadio

https://functionaljobs.com/jobs/8860-clojure-engineer-at-mixradio



Cheers,

Sean Murphy

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


Onyx Cheat Sheet

2015-10-26 Thread Michael Drogalis
Onyx  [https://github.com/onyx-platform/onyx] is a distributed, fault 
tolerant, high performance data processing
platform for Clojure that supports batch and streaming workloads. The 
majority of the surface area of its API
is data-driven. We've documented the information model in several ways, and 
today we're announcing another
branch of documentation.

The Onyx Platform is pleased to release the Cheat Sheet 
[http://www.onyxplatform.org/cheat-sheet.html].
We hope this helps you navigate the increasingly-large information model 
that Onyx offers. We're also
happy to take any suggestions about how to make it better.

Cheers!
-- Michael


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


Need help setting up Emacs for Clojure on Windows 8

2015-10-26 Thread Tina Ramsey
I'm trying to follow the *Clojure for the Brave and True* instructions for 
installing Emacs and setting it up with clojure-mode, CIDER, etc. I can't 
get it working on Windows. This is my work machine so there isn't really a 
choice what OS to use. With the same instructions I had little trouble 
getting everything set up on my laptop running OS X.
I can install and run Emacs, but it never seems to find or install any of 
my configuration options. I'm following 
this: http://www.braveclojure.com/basic-emacs/ . Getting stuck at 
"Configuration" - I still see the basic Emacs GNU welcome screen when I 
open Emacs, the Cider package isn't listed in the package list, even after 
refresh, and it never installs any packages. What am I missing?

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


Examples of core.async usage in production?

2015-10-26 Thread juan.facorro
Hi all,

>From what I've seen/heard/understand core.async has been mostly used in 
production on the *client side* or UI programming, since it frees us from 
the dreaded callback hell. There are some instances where *core.async* is 
used on the *server side* to provide asynchronous communication between 
client and server [1][2]; and I wonder how many are using those 
libraries/features and how. 

I'm sure there are a lot more libraries built on top of *core.async* to be 
used on the server, but my question/survey is related to *how many of those 
are used in production today*. I have also found some comments about using 
Pulsar  as an alternative for 
asynchronous message passing scenarios [3][4]. How many of you have gone 
that way instead?

Looking forward to your comments & replies.

Cheers!
Juan

[1] https://github.com/ptaoussanis/sente
[2] https://github.com/bguthrie/async-sockets
[3] https://groups.google.com/d/msg/clojure/m6bqGd8vQZQ/hR5rxE4oHSMJ
[4] 
http://stackoverflow.com/questions/32299299/is-it-safe-to-use-clojure-core-async-in-production-even-though-its-alpha

-- 
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: Need help setting up Emacs for Clojure on Windows 8

2015-10-26 Thread David Powell
(There shouldn't actually be any problem using ~ from within emacs in
Windows though - emacs will automatically handle it - I do it all the
time.  It is probably related to emacs using
"C:\Users\jason\AppData\Roaming" as its home directory though.)

On Mon, Oct 26, 2015 at 6:09 PM, Daniel Higginbotham 
wrote:
>
> Sorry you're having trouble! Does this help?
https://www.reddit.com/r/Clojure/comments/3pn3fo/clojure_for_the_brave_and_true_updated_to_match/cw8h8qy
>

-- 
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: Need help setting up Emacs for Clojure on Windows 8

2015-10-26 Thread Daniel Higginbotham
Sorry you're having trouble! Does this 
help? 
https://www.reddit.com/r/Clojure/comments/3pn3fo/clojure_for_the_brave_and_true_updated_to_match/cw8h8qy

On Monday, October 26, 2015 at 1:56:15 PM UTC-4, Tina Ramsey wrote:
>
> I'm trying to follow the *Clojure for the Brave and True* instructions 
> for installing Emacs and setting it up with clojure-mode, CIDER, etc. I 
> can't get it working on Windows. This is my work machine so there isn't 
> really a choice what OS to use. With the same instructions I had little 
> trouble getting everything set up on my laptop running OS X.
> I can install and run Emacs, but it never seems to find or install any of 
> my configuration options. I'm following this: 
> http://www.braveclojure.com/basic-emacs/ . Getting stuck at 
> "Configuration" - I still see the basic Emacs GNU welcome screen when I 
> open Emacs, the Cider package isn't listed in the package list, even after 
> refresh, and it never installs any packages. What am I missing?
>

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