[ANN] antizer 0.2.0

2017-06-29 Thread Michael Lim


https://github.com/priornix/antizer


Antizer  has just been released. It is 
a ClojureScript library implementing Ant Design  React 
components for Reagent and Rum.

Ant Design is an enterprise-class UI design language and React-based 
implementation with the following features:

   - An enterprise-class UI design language for web applications.
   - A set of high-quality React components out of the box.
   - Extensive API documentation and examples.

Examples and Documentation

   - 
   
   Reagent Demo 
   
   - 
   
   Rum Demo 
   - 
   
   Antizer Documentation https://priornix.github.io/antizer/latest/
   - 
   
   API Documentation https://priornix.github.io/antizer/latest/api/
   
Github project: https://github.com/priornix/antizer

-- 
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: def partially done when used in if

2017-06-29 Thread Justin Smith
It creates an "undefined" var if the def gets compiled but doesn't get run.
This isn't the same as an "undefined behavior" as is documented for
languages that have formal specifications (clojure of course has none). I
did qualify that def / defn inside other forms are "generally" a sign of
bad design. There are of course special cases where they might be the least
bad option.

On Thu, Jun 29, 2017 at 3:15 PM Kaiming Yang  wrote:

> Thanks Justin,
>
> Sadly in my case those mutable container will not work because I was
> making a monkey-patch to a bug in a macro from other package.
>
> Despite what I was doing, I think "a bad design" in clojure spec is too
> weak to fit this situation. If someone tells me "it is a bad design" I
> would think I will spend more development/computation time to make it work
> but I would still expect *correct* result. "An undefined behavior" would be
> a more suitable.
>
>
> On Thursday, June 29, 2017 at 1:15:23 PM UTC-7, Justin Smith wrote:
>
>> Clojure's compiler (there's no interpreter) creates vars for every def
>> inside a form it compiles. Before the def actually runs it's unbound (as if
>> you had used declare).
>>
>> Generally def and defn that are not top level forms are signs of a bad
>> design. If you need runtime rebinding use a proper mutable container like
>> and atom, ref, or agent, this is what they are for, and they eliminate a
>> number of gotchas that come with runtime redefinition.
>>
>> On Thu, Jun 29, 2017 at 1:07 PM Kaiming Yang  wrote:
>>
> Hi,
>>> Recently encountered a weird issue, A def in if clause declared a var
>>> but left it unbound.
>>>
>>> I encountered this issue when I was trying to implement something like
>>> "define a symbol if it is not defined yet". Naively I tried:
>>>
>>> (if (nil? (resolve 'foo))
>>>   (def foo 42))
>>> ; Cannot use (def foo (if (nil? (resolve 'foo)) foo 42)) because foo
>>> might be macro
>>>
>>> I tried in repl and the result really surprised me:
>>>
>>> user=> foo
>>>
>>> CompilerException java.lang.RuntimeException: Unable to resolve symbol:
>>> foo in this context,
>>> compiling:(/private/var/folders/1h/vhl8yb657mjf3pchm9cbc40m63f2d3/T/form-init8893781347079502941.clj:1:1062)
>>> user=> (if (nil? (resolve 'foo))
>>>   #_=>   (do (def foo 42) (prn "true-branch"))
>>>   #_=>   (prn "false-branch"))
>>> "false-branch"
>>> nil
>>> user=> foo
>>> #object[clojure.lang.Var$Unbound 0x6dc69f03 "Unbound: #'user/foo"]
>>>
>>> Seems once clojure interpreter declares the variable before really
>>> evaluate the clause with def.
>>>
>>> Is this an expected behavior? Should I ever use def in if or fn?
>>>
>>> Thanks!
>>> Kaiming
>>>
>>> --
>>> 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.
>

-- 
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: def partially done when used in if

2017-06-29 Thread Kaiming Yang
Thanks Justin,

Sadly in my case those mutable container will not work because I was making 
a monkey-patch to a bug in a macro from other package.

Despite what I was doing, I think "a bad design" in clojure spec is too 
weak to fit this situation. If someone tells me "it is a bad design" I 
would think I will spend more development/computation time to make it work 
but I would still expect *correct* result. "An undefined behavior" would be 
a more suitable.


On Thursday, June 29, 2017 at 1:15:23 PM UTC-7, Justin Smith wrote:
>
> Clojure's compiler (there's no interpreter) creates vars for every def 
> inside a form it compiles. Before the def actually runs it's unbound (as if 
> you had used declare).
>
> Generally def and defn that are not top level forms are signs of a bad 
> design. If you need runtime rebinding use a proper mutable container like 
> and atom, ref, or agent, this is what they are for, and they eliminate a 
> number of gotchas that come with runtime redefinition.
>
> On Thu, Jun 29, 2017 at 1:07 PM Kaiming Yang  > wrote:
>
>> Hi,
>> Recently encountered a weird issue, A def in if clause declared a var but 
>> left it unbound.
>>
>> I encountered this issue when I was trying to implement something like 
>> "define a symbol if it is not defined yet". Naively I tried:
>>
>> (if (nil? (resolve 'foo)) 
>>   (def foo 42))  
>> ; Cannot use (def foo (if (nil? (resolve 'foo)) foo 42)) because foo 
>> might be macro
>>
>> I tried in repl and the result really surprised me:
>>
>> user=> foo
>>
>> CompilerException java.lang.RuntimeException: Unable to resolve symbol: 
>> foo in this context, 
>> compiling:(/private/var/folders/1h/vhl8yb657mjf3pchm9cbc40m63f2d3/T/form-init8893781347079502941.clj:1:1062)
>> user=> (if (nil? (resolve 'foo))
>>   #_=>   (do (def foo 42) (prn "true-branch"))
>>   #_=>   (prn "false-branch"))
>> "false-branch"
>> nil
>> user=> foo
>> #object[clojure.lang.Var$Unbound 0x6dc69f03 "Unbound: #'user/foo"]
>>
>> Seems once clojure interpreter declares the variable before really 
>> evaluate the clause with def. 
>>
>> Is this an expected behavior? Should I ever use def in if or fn?
>>
>> Thanks!
>> Kaiming
>>
>> -- 
>> 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: def partially done when used in if

2017-06-29 Thread Justin Smith
Clojure's compiler (there's no interpreter) creates vars for every def
inside a form it compiles. Before the def actually runs it's unbound (as if
you had used declare).

Generally def and defn that are not top level forms are signs of a bad
design. If you need runtime rebinding use a proper mutable container like
and atom, ref, or agent, this is what they are for, and they eliminate a
number of gotchas that come with runtime redefinition.

On Thu, Jun 29, 2017 at 1:07 PM Kaiming Yang  wrote:

> Hi,
> Recently encountered a weird issue, A def in if clause declared a var but
> left it unbound.
>
> I encountered this issue when I was trying to implement something like
> "define a symbol if it is not defined yet". Naively I tried:
>
> (if (nil? (resolve 'foo))
>   (def foo 42))
> ; Cannot use (def foo (if (nil? (resolve 'foo)) foo 42)) because foo
> might be macro
>
> I tried in repl and the result really surprised me:
>
> user=> foo
>
> CompilerException java.lang.RuntimeException: Unable to resolve symbol:
> foo in this context,
> compiling:(/private/var/folders/1h/vhl8yb657mjf3pchm9cbc40m63f2d3/T/form-init8893781347079502941.clj:1:1062)
> user=> (if (nil? (resolve 'foo))
>   #_=>   (do (def foo 42) (prn "true-branch"))
>   #_=>   (prn "false-branch"))
> "false-branch"
> nil
> user=> foo
> #object[clojure.lang.Var$Unbound 0x6dc69f03 "Unbound: #'user/foo"]
>
> Seems once clojure interpreter declares the variable before really
> evaluate the clause with def.
>
> Is this an expected behavior? Should I ever use def in if or fn?
>
> Thanks!
> Kaiming
>
> --
> 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.


def partially done when used in if

2017-06-29 Thread Kaiming Yang
Hi,
Recently encountered a weird issue, A def in if clause declared a var but 
left it unbound.

I encountered this issue when I was trying to implement something like 
"define a symbol if it is not defined yet". Naively I tried:

(if (nil? (resolve 'foo)) 
  (def foo 42))  
; Cannot use (def foo (if (nil? (resolve 'foo)) foo 42)) because foo might 
be macro

I tried in repl and the result really surprised me:

user=> foo

CompilerException java.lang.RuntimeException: Unable to resolve symbol: foo 
in this context, 
compiling:(/private/var/folders/1h/vhl8yb657mjf3pchm9cbc40m63f2d3/T/form-init8893781347079502941.clj:1:1062)
user=> (if (nil? (resolve 'foo))
  #_=>   (do (def foo 42) (prn "true-branch"))
  #_=>   (prn "false-branch"))
"false-branch"
nil
user=> foo
#object[clojure.lang.Var$Unbound 0x6dc69f03 "Unbound: #'user/foo"]

Seems once clojure interpreter declares the variable before really evaluate 
the clause with def. 

Is this an expected behavior? Should I ever use def in if or fn?

Thanks!
Kaiming

-- 
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: fdef for defmulti?

2017-06-29 Thread Alex Miller
I don't think there is a jira issue for it, feel free to add it. Not 
currently a priority for us but if someone wanted to work on it, I'd be 
happy to review.

On Thursday, June 29, 2017 at 1:47:36 PM UTC-5, Derek Thurn wrote:
>
> I'm also interested in this functionality. Is there an existing JIRA issue 
> we can follow for allowing specs for multimethods?
>
> On Thursday, 18 August 2016 05:32:01 UTC-7, Patrik Sundberg wrote:
>>
>> Hi,
>>
>> Am I right to think you can't currently fdef a defmulti function? I tried 
>> and when running tests using clojure.spec.test/instrument I see:
>> 1. Unhandled java.lang.ClassCastException
>>clojure.spec.test$spec_checking_fn$fn__12959 cannot be cast to
>>clojure.lang.MultiFn
>>
>>   core.clj: 1806  clojure.core/get-method
>>   core.clj: 1806  clojure.core/get-method
>>time_series.clj:  474  tulos.time-series/eval181936/fn
>>
>> So I guess what happens is the fdef+instrument adds a normal fn wrapper, 
>> which then isn't a multi method and it breaks down.
>>
>> Has this been discussed before? Any plans? I didn't find anything.
>>
>> Thanks,
>> Patrik
>>
>>

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


[ANN] clojure.java.jdbc 0.7.0 Beta 1

2017-06-29 Thread Sean Corfield
What?
Clojure’s contrib wrapper for JDBC.

Where?
https://github.com/clojure/java.jdbc
[org.clojure/java.jdbc “0.7.0-beta1”]

Summary?
Adds reducible queries; Drops support for Clojure 1.4.0 (see below).

Details?

A new function, reducible-query, has been added that accepts a db-spec and a 
SQL/parameters vector, and returns a “reducible collection”. The query doesn’t 
actually run until you reduce it. At that point, it sets up the 
PreparedStatement, runs the query, and processes the ResultSet – by creating an 
interim “reducible collection” version of that result set and delegating your 
reduce operation to that. The connection is automatically closed when reduction 
completes, either by processing the entire result set or by returning a 
‘reduced’ value. If you’re on Clojure 1.7 or later, you can therefore use 
reducible-query with transducers. Note that the reducible collection returned 
by reducible-query can be processed multiple times and the query will be run 
each time. There’s also a reducible-result-set helper function which will 
transform a ResultSet into a single-pass reducible collection if you need to 
drop down to that level (which you can use with the existing 
db-query-with-resultset function).

Clojure version support?
This beta release supports Clojure 1.5 forward.
It implements reducible queries using CollReduce on Clojure 1.5/1.6.
It implements reducible queries using IReduce on Clojure 1.7+
I’d prefer to use IReduceInit and only support Clojure 1.7+ going 
forward.
Please provide feedback on how that might affect you:
https://www.surveymonkey.com/r/MR2HRFD

Thanks to?
Kevin Downey for opening https://dev.clojure.org/jira/browse/JDBC-99 
three years ago and Ghadi Shayban for the outline of the reducible ResultSet!

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

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)




-- 
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: fdef for defmulti?

2017-06-29 Thread Derek Thurn
I'm also interested in this functionality. Is there an existing JIRA issue 
we can follow for allowing specs for multimethods?

On Thursday, 18 August 2016 05:32:01 UTC-7, Patrik Sundberg wrote:
>
> Hi,
>
> Am I right to think you can't currently fdef a defmulti function? I tried 
> and when running tests using clojure.spec.test/instrument I see:
> 1. Unhandled java.lang.ClassCastException
>clojure.spec.test$spec_checking_fn$fn__12959 cannot be cast to
>clojure.lang.MultiFn
>
>   core.clj: 1806  clojure.core/get-method
>   core.clj: 1806  clojure.core/get-method
>time_series.clj:  474  tulos.time-series/eval181936/fn
>
> So I guess what happens is the fdef+instrument adds a normal fn wrapper, 
> which then isn't a multi method and it breaks down.
>
> Has this been discussed before? Any plans? I didn't find anything.
>
> Thanks,
> Patrik
>
>

-- 
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: error in nrepl

2017-06-29 Thread Didier
If you're no fan on emacs or vim, ProtoRepl is great. I also recommend cursive, 
but if you're no fan of intelliJ autosave, counterclockwise eclipse os 
surprisingly great. 

-- 
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: error in nrepl

2017-06-29 Thread lawrence . krubner


Thank you for everyone's reply. Both Spacemacs and ProtoRepl sound very 
interesting. I am torn and am unsure which path to take. I suppose I'll 
give Spacemacs a try and see if that works out.

I am very pleased to see progress being made regarding at least the DE of 
IDE for Clojure. That's always been a pain point. 



On Monday, June 26, 2017 at 12:44:45 PM UTC-4, Bozhidar Batsov wrote:
>
> Newer versions of CIDER are much easier to setup than the older ones (e.g. 
> they auto-inject their dependencies, so you don't have to fiddle with 
> profiles.clj). You should try the latest stable or dev release. That said 
> you can also check Monroe (https://github.com/sanel/monroe) which is a 
> fork of a very old version of CIDER (from around the time it was named 
> nrepl.el) or inf-clojure (https://github.com/clojure-emacs/inf-clojure) - 
> a completely 0-setup Clojure(Script) REPL with support for connecting to a 
> REPL socket server. 
>
> On 24 June 2017 at 00:36, > wrote:
>
>>
>> Yes, sadly, I've never gotten Cider to work with Emacs. I keep thinking 
>> someday I'll take a weekend and work through all the errors and get it 
>> working, but I never seem to find the time. So I keep working with an old 
>> version of nrepl. But I take it, from your answer, you think this error 
>> would vanish if I upgraded to Cider? 
>>
>>
>>
>>
>> On Friday, June 23, 2017 at 5:15:09 PM UTC-4, James Reeves wrote:
>>>
>>> nrepl-jack-in? Do you mean cider-jack-in? AFAIK nrepl-jack-in is from a 
>>> very old version of Cider.
>>>
>>> On 23 June 2017 at 21:29,  wrote:
>>>
 I'm using Emacs on my Mac. I ran "nrepl-jack-in" to load up the repl. 
 I'm iterating over a dataset from mysql. My code is very simple, I'm just 
 trying to count the words: 

 (reduce 

 (fn [map-of-word-count next-name] 
 (let [
 words (clojure.string/split next-name #"\s") 
 map-of-names-words-with-count (frequencies words)
 ] 
 (println map-of-names-words-with-count)
 (merge-with + map-of-word-count map-of-names-words-with-count)
 )
 ) 
 {} 
 names)

 I keep getting this message:


 error in process filter: nrepl-bdecode-buffer: Cannot decode object: 1
 error in process filter: Cannot decode object: 1
 Error running timer `jit-lock-stealth-fontify': (error "Variable 
 binding depth exceeds max-specpdl-size")
 timer-relative-time: Variable binding depth exceeds max-specpdl-size


 Does anyone know what this means? 

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

>>>
>>>
>>>
>>> -- 
>>> James Reeves
>>> booleanknot.com
>>>
>> -- 
>> 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.


Spec's not being checked on macro expansion

2017-06-29 Thread Ed Bowler
Hi,
I've got a problem where specs are not always being checked during macro
expansion. It seems to be reliably be checked when I load the code using
cider (using cider-load-buffer), but not when running lein test at the
terminal.

Code:

(defproject macroexpand-spec-test "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME";
  :license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.9.0-alpha17"]])

(ns macroexpand-spec-test.core-test
  (:require [clojure.test :refer :all]
[macroexpand-spec-test.core :refer :all]))

(deftest a-test
  (testing "FIXME, I fail."
(is (thrown? Exception (macroexpand '(fish "not a symbol" 1))

(ns macroexpand-spec-test.core
  (:require [clojure.spec.alpha :as s]))

(s/fdef fish
:args (s/cat :func symbol?
 :args (s/* any?))
:ret any?)

(defmacro fish [f & args]
  `(~f ~@args))

However, the minimal case works correctly:

$ rlwrap java -cp
/home/aviso/.m2/repository/org/clojure/clojure/1.9.0-alpha17/clojure-1.9.0-alpha17.jar:/home/aviso/.m2/repository/org/clojure/spec.alpha/0.1.123/spec.alpha-0.1.123.jar:/home/aviso/.m2/repository/org/clojure/core.specs.alpha/0.1.10/core.specs.alpha-0.1.10.jar
clojure.main
Clojure 1.9.0-alpha17
user=> (require '[clojure.spec.alpha :as s])
nil
user=> (s/fdef fish
:args (s/cat :func symbol?
 :args (s/* any?))
:ret any?)
user/fish
user=> (defmacro fish [f & args]
  `(~f ~@args))
#'user/fish
user=> (macroexpand '(fish "not a symbol" 1))
CompilerException clojure.lang.ExceptionInfo: Call to user/fish did not
conform to spec:
In: [0] val: "not a symbol" fails at: [:args :func] predicate: symbol?



Is this a bug in lein? I'm getting the same failure using gradle (which is
where the problem first showed up, and I switched to lein to find a smaller
failing case).

Many thanks for any help,

Ed

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