Re: Releasing scope-capture, a library for easing REPL-based debugging

2017-10-09 Thread Val Waeselynck
Le 9 oct. 2017 18:17, "Didier"  a écrit :

What happens with loops? Say if you spy inside a for?


It records and logs new information on each iteration :) see `disable!`
and/or `brk` if that's inconvenient.

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


New Course on Clojurecademy: Code Katas

2017-10-09 Thread Ertuğrul Çetin
Hey Everyone,

I've released a new course called *Code Katas* on Clojurecademy, which is a 
curated list of Clojure Code 
Katas: https://clojurecademy.com/courses/17592186068882/learn/overview

-- 
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: Help with strange test output when deftest used inside a macro

2017-10-09 Thread Timothy Baldridge
The problem isn't the macro, it's your use of syntax quoting. `(= x y) gets
expanded at read-time into `(clojure.core/= x y)`. Not much you can do
about that. Although I'd suggest perhaps changing your code a bit to not
require macros.

deftest mostly just creates a defn with some extra metadata and the like.
One option would be to use a dynamic var to setup your config information.
Or better yet have the test itself read the config data the way your normal
app would. This not only exercises the same config codepaths, but it also
keeps the code quite functional.

On Mon, Oct 9, 2017 at 2:40 PM, Matt Grimm  wrote:

> Hello,
>
> I'm generating deftest's using a helper macro that takes a variety of test
> parameters and though the tests function correctly, the output of a failed
> test is not exactly right. The expect value is shown as the un-evaluated
> test form, and the actual value is shown as the result of evaluating the
> test form. I realize 'is' is a macro itself, but I'm not quite sure how to
> expand or escape the guts of my macro to make the output match that of a
> normal test.
>
> Whereas a normal test failure looks like this (some output elided):
>
> user=> (deftest normal-test
>   #_=>   (is (= [0 1 5] (range 3
> #'user/normal-test
> user=> (run-tests)
>
> FAIL in (normal-test)
>
> expected: [0 1 5]
>   actual: ((0 1 2))
>
> A failure for a deftest defined within a macro comes out like this:
>
> user=> (defmacro defnesttest [v]
>   #_=>   `(deftest nested-test
>   #_=>  (is (= [0 1 5] ~v
> #'user/defnesttest
> user=> (defnesttest (range 3))
> #'user/nested-test
> user=> (run-tests)
>
> FAIL in (nested-test)
>
> expected: (clojure.core/= [0 1 5] (range 3))
>   actual: false
>
> Thanks for any insight,
> m.
>
> --
> 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.
>



-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)

-- 
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: Can slingshot/try+ and then catch Object really catch any error?

2017-10-09 Thread lawrence . krubner
I figured a common reason for error messages to disappear is when there is 
another Exception inside of the catch block, so the catch block itself dies 
without doing anything. 

I had copy-and-pasted this from somewhere, without looking at it much:

   (catch Exception e
 (println e)
 (stack/parse-exception e)
 (throw (ex-info "The app has died!")))

It took me awhile before I saw this: 

:type clojure.lang.ArityException
   :message Wrong number of args (1) passed to: core/ex-info
   :at [clojure.lang.AFn throwArity AFn.java 429]}]

Looking here reveals that there is no one argument version of ex-info:

https://clojuredocs.org/clojure.core/ex-info

My fault, obviously, for being careless when mixing different kinds of 
error reporting. 


On Monday, October 9, 2017 at 2:59:35 PM UTC-4, Sean Corfield wrote:
>
> Timbre has a logged-future macro that you can use instead of future so 
> that exceptions are automatically logged.
>
>  
>
> Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
> An Architect's View -- http://corfield.org/
>
> "If you're not annoying somebody, you're not really alive."
> -- Margaret Atwood
>
>  
> --
> *From:* clo...@googlegroups.com   > on behalf of lawrence...@gmail.com  <
> lawrence...@gmail.com >
> *Sent:* Monday, October 9, 2017 11:23:05 AM
> *To:* Clojure
> *Subject:* Re: Can slingshot/try+ and then catch Object really catch any 
> error? 
>  
> MatchingSocks, thanks for that. I think the pattern I followed everywhere 
> was: 
>
> (future
>   (slingshot/try+
>  ;;; some code
> (catch Object o
>(println o
>
> So I think I do catch everything inside of each future that I launch. But 
> I will check again. Perhaps I missed one somewhere.
>
>
> On Monday, October 9, 2017 at 8:12:33 AM UTC-4, Matching Socks wrote: 
>>
>> The linked page 
>> https://stuartsierra.com/2015/05/27/clojure-uncaught-exceptions also 
>> says "Another wrinkle: exceptions inside a future are always caught by the 
>> Future. The exception will not be thrown until something calls Future.get 
>> (deref in Clojure)."  So you would need to review the pattern of "(try 
>> (future (catch (throw".
>>
> -- 
> 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: Can slingshot/try+ and then catch Object really catch any error?

2017-10-09 Thread lawrence . krubner
Sean Corfield, thank you, that is a great tip.


On Monday, October 9, 2017 at 2:59:35 PM UTC-4, Sean Corfield wrote:
>
> Timbre has a logged-future macro that you can use instead of future so 
> that exceptions are automatically logged.
>
>  
>
> Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
> An Architect's View -- http://corfield.org/
>
> "If you're not annoying somebody, you're not really alive."
> -- Margaret Atwood
>
>  
> --
> *From:* clo...@googlegroups.com   > on behalf of lawrence...@gmail.com  <
> lawrence...@gmail.com >
> *Sent:* Monday, October 9, 2017 11:23:05 AM
> *To:* Clojure
> *Subject:* Re: Can slingshot/try+ and then catch Object really catch any 
> error? 
>  
> MatchingSocks, thanks for that. I think the pattern I followed everywhere 
> was: 
>
> (future
>   (slingshot/try+
>  ;;; some code
> (catch Object o
>(println o
>
> So I think I do catch everything inside of each future that I launch. But 
> I will check again. Perhaps I missed one somewhere.
>
>
> On Monday, October 9, 2017 at 8:12:33 AM UTC-4, Matching Socks wrote: 
>>
>> The linked page 
>> https://stuartsierra.com/2015/05/27/clojure-uncaught-exceptions also 
>> says "Another wrinkle: exceptions inside a future are always caught by the 
>> Future. The exception will not be thrown until something calls Future.get 
>> (deref in Clojure)."  So you would need to review the pattern of "(try 
>> (future (catch (throw".
>>
> -- 
> 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.


Help with strange test output when deftest used inside a macro

2017-10-09 Thread Matt Grimm
Hello,

I'm generating deftest's using a helper macro that takes a variety of test 
parameters and though the tests function correctly, the output of a failed 
test is not exactly right. The expect value is shown as the un-evaluated 
test form, and the actual value is shown as the result of evaluating the 
test form. I realize 'is' is a macro itself, but I'm not quite sure how to 
expand or escape the guts of my macro to make the output match that of a 
normal test.

Whereas a normal test failure looks like this (some output elided):

user=> (deftest normal-test
  #_=>   (is (= [0 1 5] (range 3
#'user/normal-test
user=> (run-tests)

FAIL in (normal-test)

expected: [0 1 5]
  actual: ((0 1 2)) 

A failure for a deftest defined within a macro comes out like this:

user=> (defmacro defnesttest [v]
  #_=>   `(deftest nested-test
  #_=>  (is (= [0 1 5] ~v
#'user/defnesttest
user=> (defnesttest (range 3))
#'user/nested-test
user=> (run-tests)

FAIL in (nested-test)

expected: (clojure.core/= [0 1 5] (range 3))
  actual: false

Thanks for any insight,
m.

-- 
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: Migrating nREPL out of Clojure Contrib

2017-10-09 Thread Chas Emerick
I have opened two issues on the original nREPL repo:

1. Describing the background and rationale for the work to be done:
https://github.com/cemerick/nREPL/issues/1

2. Enumerating the nREPL contributors to obtain explicit permission for
their commits to be distributed under the terms of EPL only (i.e. absent
the terms of the CA that governed their contribution to the tools.nrepl
project): https://github.com/cemerick/nREPL/issues/2

Once #2 is complete, then the list of tasks in #1 will be burned down.
We'll then have a 100% compatible nREPL release out the door with
different maven coordinates, etc., and those that are interested in
contributing will be able to do so straightforwardly.

Cheers,

- Chas

On 8/3/2017 00:36, Bozhidar Batsov wrote:
> So, what's the next step here?


-- 
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: Can slingshot/try+ and then catch Object really catch any error?

2017-10-09 Thread Sean Corfield
Timbre has a logged-future macro that you can use instead of future so that 
exceptions are automatically logged.

Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood


From: clojure@googlegroups.com  on behalf of 
lawrence.krub...@gmail.com 
Sent: Monday, October 9, 2017 11:23:05 AM
To: Clojure
Subject: Re: Can slingshot/try+ and then catch Object really catch any error?

MatchingSocks, thanks for that. I think the pattern I followed everywhere was:

(future
  (slingshot/try+
 ;;; some code
(catch Object o
   (println o

So I think I do catch everything inside of each future that I launch. But I 
will check again. Perhaps I missed one somewhere.


On Monday, October 9, 2017 at 8:12:33 AM UTC-4, Matching Socks wrote:
The linked page https://stuartsierra.com/2015/05/27/clojure-uncaught-exceptions 
also says "Another wrinkle: exceptions inside a future are always caught by the 
Future. The exception will not be thrown until something calls Future.get 
(deref in Clojure)."  So you would need to review the pattern of "(try (future 
(catch (throw".

--
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: Can slingshot/try+ and then catch Object really catch any error?

2017-10-09 Thread lawrence . krubner
Gary Verhaegen, thanks for that. The idea of buffers and threads dying is a 
good one and gives me something to look for. 


On Monday, October 9, 2017 at 2:23:05 PM UTC-4, lawrence...@gmail.com wrote:
>
> MatchingSocks, thanks for that. I think the pattern I followed everywhere 
> was:
>
> (future
>   (slingshot/try+
>  ;;; some code
> (catch Object o
>(println o
>
> So I think I do catch everything inside of each future that I launch. But 
> I will check again. Perhaps I missed one somewhere.
>
>
> On Monday, October 9, 2017 at 8:12:33 AM UTC-4, Matching Socks wrote:
>>
>> The linked page 
>> https://stuartsierra.com/2015/05/27/clojure-uncaught-exceptions also 
>> says "Another wrinkle: exceptions inside a future are always caught by the 
>> Future. The exception will not be thrown until something calls Future.get 
>> (deref in Clojure)."  So you would need to review the pattern of "(try 
>> (future (catch (throw".
>>
>

-- 
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: Can slingshot/try+ and then catch Object really catch any error?

2017-10-09 Thread lawrence . krubner
MatchingSocks, thanks for that. I think the pattern I followed everywhere 
was:

(future
  (slingshot/try+
 ;;; some code
(catch Object o
   (println o

So I think I do catch everything inside of each future that I launch. But I 
will check again. Perhaps I missed one somewhere.


On Monday, October 9, 2017 at 8:12:33 AM UTC-4, Matching Socks wrote:
>
> The linked page 
> https://stuartsierra.com/2015/05/27/clojure-uncaught-exceptions also says 
> "Another wrinkle: exceptions inside a future are always caught by the 
> Future. The exception will not be thrown until something calls Future.get 
> (deref in Clojure)."  So you would need to review the pattern of "(try 
> (future (catch (throw".
>

-- 
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: Is there a better way to get to `Classname[].class` ?

2017-10-09 Thread pericles macedo
Hey Gary, thanks for the help
I'm not sure if a type hint would work in this case, as the attribute 
expect a class literal, and not a variable of that specific class. Thanks 
for the example though, I didn't know that was a valid type hint.
About what I'm trying to do, I'm using a gitlab api gem 
(https://github.com/timols/java-gitlab-api), and I need to do some java 
interop with it.
I'm trying to get a list of projects filtered by name, but the call java 
does doesn't build the search attribute, so I just get all projects, not 
filtered by name.
I'm able to get on java by using something like 
`connection.retrieve().getAll(buildUrl(project), GitlabProject[].class);`. 
The getAll expects a string, and a class literal.
If the return from gitlab wasn't an array, I could just use GitlabProject 
on clojure, and that would give me a result. As it's an array, I get an 
error showing it can't build a GitlabProject out of ARRAY_START.

My solution to make that call was 
(def get-project
   
(memoize
  
  (fn [project]
   
(-> connection  
 
.retrieve  
  
(.getAll (build-url project) (array-class-for 
GitlabProject)) 

 
(defn array-class-for [class-name]  
   
  (class (make-array class-name 1)))



On Monday, October 9, 2017 at 9:20:37 AM UTC-7, Gary Verhaegen wrote:
>
> You can generally use ^"[fully.qualified.ClassName" as the type hint, if 
> that's what you're trying to do. I'm not quite sure of the benefits of 
> typing an array when it's not a primitive one, though.
>
> What are you trying to accomplish, if we zoom back a little bit? Maybe 
> there's a better way to do whatever you're trying to do.
>
> On 9 Oct 2017, at 16:36, pericles macedo  > wrote:
>
> Hey Guys,
> I wanted to know if there is a better way to get to the same result as 
> `GitlabProject[].class`
> after some digging around, I got to this array of class definition by 
> doing something like `(class (make-array GitlabProject 1))`. But I don't 
> know if there is a better way to get to this same result. 
> In Java, this array of class is sent as an attribute that is used to build 
> the array of objects that is returned. like: `retrieve().getAll(tailUrl, 
> GitlabProject[].class);`
>
>
> Thanks for your time,
> Pericles Dantas
>
> -- 
> 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: Is there a better way to get to `Classname[].class` ?

2017-10-09 Thread pericles macedo
Thanks Alex :)
Yes, that works better

On Monday, October 9, 2017 at 9:21:24 AM UTC-7, Alex Miller wrote:
>
> (Class/forName "[Lorg.gitlab.api.models.GitlabProject;")
>
>
> On Monday, October 9, 2017 at 10:38:37 AM UTC-5, pericles macedo wrote:
>>
>> Hey Guys,
>> I wanted to know if there is a better way to get to the same result as 
>> `GitlabProject[].class`
>> after some digging around, I got to this array of class definition by 
>> doing something like `(class (make-array GitlabProject 1))`. But I don't 
>> know if there is a better way to get to this same result. 
>> In Java, this array of class is sent as an attribute that is used to 
>> build the array of objects that is returned. like: 
>> `retrieve().getAll(tailUrl, GitlabProject[].class);`
>>
>>
>> Thanks for your time,
>> Pericles Dantas
>>
>

-- 
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: [core.spec] Stricter map validations?

2017-10-09 Thread Beau Fabry
> The argument that existence of specs provided to s/keys can only be 
checked at runtime is false.

> The argument that that recursive specs are impossible if existence of 
specs provided to s/keys was checked at compile time is also false. 

Could you explain to us why this is false? Clojure is a dynamic language, 
as such I don't see how you could define a time when all specs need to be 
present. How would I enter this spec at the repl if spec definition was 
required at s/keys invocation time?

boot.user=> (s/def ::val string?)
:boot.user/val
boot.user=> (s/def ::tree (s/keys :opt-un [::val ::branches]))
:boot.user/tree
boot.user=> (s/def ::branches (s/tuple ::tree ::tree))
:boot.user/branches

On Friday, October 6, 2017 at 4:32:41 PM UTC-7, Leon Grapenthin wrote:
>
> The argument that existence of specs provided to s/keys can only be 
> checked at runtime is false.
>
> The argument that that recursive specs are impossible if existence of 
> specs provided to s/keys was checked at compile time is also false. 
>
> The usecase for libraries is not convincing: If the libraries author 
> states "the map has to have a key K" nobody can spec K further since that 
> would be a race condition among consumers (who s/defs K first?). Requiring 
> the libraries author to declare K as any? would at least require him to 
> decide and convey his intent.
>
> The argument that not checking a value associated with a key is 
> corresponding to a guding design principle of map specs being based on a 
> keyset is not stating enough to justify discussed behavior. The utility of 
> knowing that a keyset is present is close to none, which should be the main 
> reasons why s/keys validates values. Again: Saying "A map that has a key 
> called ::foo" is pretty pointless in Clojure. If every map in every Clojure 
> program I wrote had a key ::foo they would all produce the exact same 
> results as if they didn't and I bet yours would, too. 
>
> Prototyping is indeed a bit more easy if one does not have to to declare 
> every spec used in a s/keys. However, that is particularly damning if you 
> forget to add that spec later or mistype its name when doing so. Which 
> happens, and which is why I'm unhappy with this design letting such typical 
> human errors pass compilation. It would also help my prototyping needs if I 
> could reference symbols that are not declared, but I prefer the compiler 
> errors before going live. 
>
> On Saturday, October 7, 2017 at 12:01:34 AM UTC+2, Sean Corfield wrote:
>>
>> As one of the (apparently pretty uncommon) users who actually does 
>> happily define s/keys specs without correspondingly speccing the leaves as 
>> an "incrementally lock down/validate" approach, I wouldn't be too upset if 
>> I lost that ability and it started throwing an error. I mean it throws an 
>> error if I go to generate it anyway.
>>
>>  
>>
>> **puts hand up!**
>>
>>  
>>
>> I don’t want to have to write (s/def ::some-key any?) all over the place 
>> as I’m developing specs, just to satisfy an overly eager checker (in my 
>> mind). Worse, since the check would need to be deferred until validation 
>> time, as Beau notes, the omission of an “any?” key spec might not even show 
>> up until much further down the line.
>>
>>  
>>
>> To me, this default behavior of silently not checking the _*value*_ 
>> associated with a _*key*_ is in keeping with the design principles of 
>> spec which focus on maps being based on a *key set*, while offering 
>> functions to allow you to optionally check values.
>>
>>  
>>
>> Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
>> An Architect's View -- http://corfield.org/
>>
>> "If you're not annoying somebody, you're not really alive."
>> -- Margaret Atwood
>>
>>  
>> --
>> *From:* clo...@googlegroups.com  on behalf of 
>> Beau Fabry 
>> *Sent:* Friday, October 6, 2017 9:10:36 AM
>> *To:* Clojure
>> *Subject:* Re: [core.spec] Stricter map validations? 
>>  
>> A use case that comes to mind is a system/library that specifies the 
>> structure of some inputs/outputs, but lets users/consumers (optionally) 
>> specify further validation of the leaves. I suppose that would be possible 
>> with (s/def ::foo any?) but you'd have to be a bit more careful about load 
>> order. The other use case (which is mine) is I'm just lazy and only want to 
>> write out broad strokes specs sometimes without getting into the nitty 
>> gritty. 
>>
>> If s/keys were to validate that the keys it's provided have specs it 
>> would have to do it at validation time, so you wouldn't get the error until 
>> something was actually validated against that key spec. Trying to do it at 
>> definition time would break recursive specs.
>>
>> As one of the (apparently pretty uncommon) users who actually does 
>> happily define s/keys specs without correspondingly speccing the leaves as 
>> an "incrementally lock down/validate" approach, I wouldn't be too upset if 
>> I lost that ability and it sta

Re: Is there a better way to get to `Classname[].class` ?

2017-10-09 Thread Alex Miller
(Class/forName "[Lorg.gitlab.api.models.GitlabProject;")


On Monday, October 9, 2017 at 10:38:37 AM UTC-5, pericles macedo wrote:
>
> Hey Guys,
> I wanted to know if there is a better way to get to the same result as 
> `GitlabProject[].class`
> after some digging around, I got to this array of class definition by 
> doing something like `(class (make-array GitlabProject 1))`. But I don't 
> know if there is a better way to get to this same result. 
> In Java, this array of class is sent as an attribute that is used to build 
> the array of objects that is returned. like: `retrieve().getAll(tailUrl, 
> GitlabProject[].class);`
>
>
> Thanks for your time,
> Pericles Dantas
>

-- 
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: Is there a better way to get to `Classname[].class` ?

2017-10-09 Thread Gary Verhaegen
You can generally use ^"[fully.qualified.ClassName" as the type hint, if that's 
what you're trying to do. I'm not quite sure of the benefits of typing an array 
when it's not a primitive one, though.

What are you trying to accomplish, if we zoom back a little bit? Maybe there's 
a better way to do whatever you're trying to do.

> On 9 Oct 2017, at 16:36, pericles macedo  wrote:
> 
> Hey Guys,
> I wanted to know if there is a better way to get to the same result as 
> `GitlabProject[].class`
> after some digging around, I got to this array of class definition by doing 
> something like `(class (make-array GitlabProject 1))`. But I don't know if 
> there is a better way to get to this same result. 
> In Java, this array of class is sent as an attribute that is used to build 
> the array of objects that is returned. like: `retrieve().getAll(tailUrl, 
> GitlabProject[].class);`
> 
> 
> Thanks for your time,
> Pericles Dantas
> -- 
> 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: Releasing scope-capture, a library for easing REPL-based debugging

2017-10-09 Thread Didier
What happens with loops? Say if you spy inside a for?

-- 
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: Releasing scope-capture, a library for easing REPL-based debugging

2017-10-09 Thread Val Waeselynck
Thanks Stu! Yes that is one of the options the library provides, though not
the one I use most.

Le 9 oct. 2017 13:44, "Stuart Halloway"  a
écrit :

> Very cool, Val!
>
> It should be possible to recreate the original scope as a let (instead of
> defs) so you don't have to worry about the names cluttering up your
> namespace.
>
> Cheers,
> Stu
>
> On Sun, Oct 8, 2017 at 10:17 PM, Jiacai Liu  wrote:
>
>> Wow, what a good idea. Thanks for sharing.
>>
>> On Mon, Oct 9, 2017 at 7:05 AM, Mike <145...@gmail.com> wrote:
>>
>>> Cool! Thanks, Val!
>>>
>>> воскресенье, 8 октября 2017 г., 10:09:19 UTC+3 пользователь Val
>>> Waeselynck написал:
>>>
 Hi, I'm happy to release a tiny Clojure/Script library called
 scope-capture .

 https://github.com/alvalval/scope-capture

 Loosely speaking, scope-capture makes it trivial to reproduce from the
 REPL the context of a piece of code after it executed.

 It was inspired by Stuart Halloway's article *REPL Debugging: no
 stacktrace required
 *.
 Thanks Stu!

 I've been using it professionally for a few weeks now, and it's been a
 significant productivity boost for me. In my view the benefits are:

- easier debugging
- making Clojure code / projects more accessible to beginners
- easier ad-hoc exploration

 Please let me know what you think!

 Valentin Waeselynck

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


Is there a better way to get to `Classname[].class` ?

2017-10-09 Thread pericles macedo
Hey Guys,
I wanted to know if there is a better way to get to the same result as 
`GitlabProject[].class`
after some digging around, I got to this array of class definition by doing 
something like `(class (make-array GitlabProject 1))`. But I don't know if 
there is a better way to get to this same result. 
In Java, this array of class is sent as an attribute that is used to build 
the array of objects that is returned. like: `retrieve().getAll(tailUrl, 
GitlabProject[].class);`


Thanks for your time,
Pericles Dantas

-- 
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: Can slingshot/try+ and then catch Object really catch any error?

2017-10-09 Thread Matching Socks
The linked 
page https://stuartsierra.com/2015/05/27/clojure-uncaught-exceptions also 
says "Another wrinkle: exceptions inside a future are always caught by the 
Future. The exception will not be thrown until something calls Future.get 
(deref in Clojure)."  So you would need to review the pattern of "(try 
(future (catch (throw".

-- 
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: Releasing scope-capture, a library for easing REPL-based debugging

2017-10-09 Thread Stuart Halloway
Very cool, Val!

It should be possible to recreate the original scope as a let (instead of
defs) so you don't have to worry about the names cluttering up your
namespace.

Cheers,
Stu

On Sun, Oct 8, 2017 at 10:17 PM, Jiacai Liu  wrote:

> Wow, what a good idea. Thanks for sharing.
>
> On Mon, Oct 9, 2017 at 7:05 AM, Mike <145...@gmail.com> wrote:
>
>> Cool! Thanks, Val!
>>
>> воскресенье, 8 октября 2017 г., 10:09:19 UTC+3 пользователь Val
>> Waeselynck написал:
>>
>>> Hi, I'm happy to release a tiny Clojure/Script library called
>>> scope-capture .
>>>
>>> https://github.com/alvalval/scope-capture
>>>
>>> Loosely speaking, scope-capture makes it trivial to reproduce from the
>>> REPL the context of a piece of code after it executed.
>>>
>>> It was inspired by Stuart Halloway's article *REPL Debugging: no
>>> stacktrace required
>>> *.
>>> Thanks Stu!
>>>
>>> I've been using it professionally for a few weeks now, and it's been a
>>> significant productivity boost for me. In my view the benefits are:
>>>
>>>- easier debugging
>>>- making Clojure code / projects more accessible to beginners
>>>- easier ad-hoc exploration
>>>
>>> Please let me know what you think!
>>>
>>> Valentin Waeselynck
>>>
>> --
>> 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.
>

-- 
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: Can slingshot/try+ and then catch Object really catch any error?

2017-10-09 Thread Gary Verhaegen
Not easy to be positive without more information about your code base, but
the only times I had symptoms that resemble what you describe, the problem
was that the JVM died before printing. That is, you have multiple threads,
and printing is asynchronous at many levels (even the terminal itself
buffers stuff). If the app dies in that condition it's actually fairly
common that messages aren't visible, even though the statement and
sometimes a few next ones have indeed run. Nothing to do with Timbre as far
as I can tell.

Maybe try to give your app a bit more wall-clock time between the error and
killing the process? (Note: I don't think you can do that by sleeping in
the shutdownhook as the JVM will not necessarily wait on that one.)

On Monday, 9 October 2017, Shantanu Kumar  wrote:

>
>
> On Monday, 9 October 2017 12:34:41 UTC+5:30, lawrence...@gmail.com
>  wrote:
>>
>> Shantanu Kumar, thanks for that, I might try it. I assume you've never
>> had the problem I'm talking about, of messages on background threads that
>> disappear?
>>
>
> Logback (the SLF4j impl we use) is capable of logging from multiple
> threads. I always set the default uncaught handler to log any exception
> arising from background threads:
> https://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html#
> setDefaultUncaughtExceptionHandler(java.lang.Thread.
> UncaughtExceptionHandler)
>
> Stuart Sierra also wrote about how to do this: https://stuartsierra.
> com/2015/05/27/clojure-uncaught-exceptions
>
> If you do this step correctly, you might be able to notice the
> background-thread exceptions even with a plain `println` call.
>
>
> Shantanu
>
>
>>
>>
>> On Monday, October 9, 2017 at 2:56:24 AM UTC-4, Shantanu Kumar wrote:
>>>
>>>

 I'm curious what others do for logging?

>>>
>>> At Concur we using Cambium https://github.com/kumarshantanu/cambium
>>> that's being moved (WIP) here: https://github.com/cambium-clojure
>>>
>>> Cambium wraps SLF4j and gives a Clojure API (which extends
>>> tools.logging) to use it's MDC feature.
>>>
>>>
>>> Shantanu
>>>
 --
> 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: The performance of plain map vs. defrecord

2017-10-09 Thread dennis zhuang
In fact they are symbols, but print as keywords:

user=> (symbol ":a")
:a
user=> (symbol? (symbol (str :a)))
true



2017-10-09 16:26 GMT+08:00 Peter Hull :

> Slightly off-topic, but why doesn't using the 'incorrect' alphabet-macro
> give an error? If I try and define a Record with keyword keys it tells me
> very clearly not to:
>
> user=> (defrecord Wrong [:a])
> CompilerException java.lang.AssertionError: defrecord and deftype fields
> must be  symbols, user.Wrong had: :a, compiling:(C:\Users\Peter\AppData\
> Local\Temp\form-init3187870874322021043.clj:1:1)
>
>
> --
> 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.
>



-- 
庄晓丹
Email:killme2...@gmail.com
Site:   http://fnil.net

不学习,毋宁死

-- 
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: The performance of plain map vs. defrecord

2017-10-09 Thread Peter Hull
Slightly off-topic, but why doesn't using the 'incorrect' alphabet-macro 
give an error? If I try and define a Record with keyword keys it tells me 
very clearly not to:

user=> (defrecord Wrong [:a])
CompilerException java.lang.AssertionError: defrecord and deftype fields 
must be  symbols, user.Wrong had: :a, compiling:(C:\Users\Peter\AppData\
Local\Temp\form-init3187870874322021043.clj:1:1)


-- 
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: Can slingshot/try+ and then catch Object really catch any error?

2017-10-09 Thread Shantanu Kumar


On Monday, 9 October 2017 12:34:41 UTC+5:30, lawrence...@gmail.com wrote:
>
> Shantanu Kumar, thanks for that, I might try it. I assume you've never had 
> the problem I'm talking about, of messages on background threads that 
> disappear?
>

Logback (the SLF4j impl we use) is capable of logging from multiple 
threads. I always set the default uncaught handler to log any exception 
arising from background threads:
https://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html#setDefaultUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler)

Stuart Sierra also wrote about how to do 
this: https://stuartsierra.com/2015/05/27/clojure-uncaught-exceptions

If you do this step correctly, you might be able to notice the 
background-thread exceptions even with a plain `println` call.


Shantanu
 

>
>
> On Monday, October 9, 2017 at 2:56:24 AM UTC-4, Shantanu Kumar wrote:
>>
>>
>>>
>>> I'm curious what others do for logging? 
>>>
>>
>> At Concur we using Cambium https://github.com/kumarshantanu/cambium 
>> that's being moved (WIP) here: https://github.com/cambium-clojure
>>
>> Cambium wraps SLF4j and gives a Clojure API (which extends tools.logging) 
>> to use it's MDC feature.
>>
>>
>> Shantanu
>>
>>>

-- 
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: Can slingshot/try+ and then catch Object really catch any error?

2017-10-09 Thread Shantanu Kumar


On Monday, 9 October 2017 12:31:57 UTC+5:30, lawrence...@gmail.com wrote:
>
> Kumar,
>
> Just so you know, on this page:
>
> https://github.com/cambium-clojure/cambium.logback.core
>
> you link to here:
>
> https://cambium-clojure.github.io/
>
> but I get a 404 when I go there. 
>


I'm sorry the https://cambium-clojure.github.io/ site is still WIP, hence 
not announced publicly yet. (I hope to be able to do that in some time.)


Shantanu

>

-- 
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: Can slingshot/try+ and then catch Object really catch any error?

2017-10-09 Thread lawrence . krubner
Shantanu Kumar, thanks for that, I might try it. I assume you've never had 
the problem I'm talking about, of messages on background threads that 
disappear?


On Monday, October 9, 2017 at 2:56:24 AM UTC-4, Shantanu Kumar wrote:
>
>
>>
>> I'm curious what others do for logging? 
>>
>
> At Concur we using Cambium https://github.com/kumarshantanu/cambium 
> that's being moved (WIP) here: https://github.com/cambium-clojure
>
> Cambium wraps SLF4j and gives a Clojure API (which extends tools.logging) 
> to use it's MDC feature.
>
>
> Shantanu
>
>>

-- 
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: Can slingshot/try+ and then catch Object really catch any error?

2017-10-09 Thread lawrence . krubner
Kumar,

Just so you know, on this page:

https://github.com/cambium-clojure/cambium.logback.core

you link to here:

https://cambium-clojure.github.io/

but I get a 404 when I go there. 



On Monday, October 9, 2017 at 2:56:24 AM UTC-4, Shantanu Kumar wrote:
>
>
>>
>> I'm curious what others do for logging? 
>>
>
> At Concur we using Cambium https://github.com/kumarshantanu/cambium 
> that's being moved (WIP) here: https://github.com/cambium-clojure
>
> Cambium wraps SLF4j and gives a Clojure API (which extends tools.logging) 
> to use it's MDC feature.
>
>
> Shantanu
>
>>

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