boolean problem

2014-04-17 Thread Roelof Wobben
Hello, 

IM working at the Iloveponies github tutorial and Im stuck here,

I have to check if x is a nil or false and then the output must be false,\
Otherwise I have to be true.

So I tried this :

(defn boolean [x]
  (if (and (nil? x) (false? x))
  )

But then I see a very long error message: 

xception in thread "main" java.lang.RuntimeException: EOF while reading, 
starting at line 4, 
compiling:(i_am_a_horse_in_the_land_of_booleans.clj:30:1)
at clojure.lang.Compiler.load(Compiler.java:7071)
at clojure.lang.RT.loadResourceScript(RT.java:370)
at clojure.lang.RT.loadResourceScript(RT.java:361)
at clojure.lang.RT.load(RT.java:440)
at clojure.lang.RT.load(RT.java:411)
at clojure.core$load$fn__5018.invoke(core.clj:5530)
at clojure.core$load.doInvoke(core.clj:5529)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5336)
at clojure.core$load_lib$fn__4967.invoke(core.clj:5375)
at clojure.core$load_lib.doInvoke(core.clj:5374)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:619)
at clojure.core$load_libs.doInvoke(core.clj:5413)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:621)
at clojure.core$use.doInvoke(core.clj:5507)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at 
iloveponies.tests.i_am_a_horse_in_the_land_of_booleans$eval6263$loading__4910__auto6264.invoke(i_am_a_horse_in_the_land_of_booleans.clj:1)
at 
iloveponies.tests.i_am_a_horse_in_the_land_of_booleans$eval6263.invoke(i_am_a_horse_in_the_land_of_booleans.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6619)
at clojure.lang.Compiler.eval(Compiler.java:6608)
at clojure.lang.Compiler.load(Compiler.java:7064)
at clojure.lang.RT.loadResourceScript(RT.java:370)
at clojure.lang.RT.loadResourceScript(RT.java:361)
at clojure.lang.RT.load(RT.java:440)
at clojure.lang.RT.load(RT.java:411)
at clojure.core$load$fn__5018.invoke(core.clj:5530)
at clojure.core$load.doInvoke(core.clj:5529)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5336)
at clojure.core$load_lib$fn__4967.invoke(core.clj:5375)
at clojure.core$load_lib.doInvoke(core.clj:5374)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:619)
at clojure.core$load_libs.doInvoke(core.clj:5413)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:621)
at clojure.core$use.doInvoke(core.clj:5507)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at 
i_am_a_horse_in_the_land_of_booleans_test$eval6257$loading__4910__auto6258.invoke(i_am_a_horse_in_the_land_of_booleans_test.clj:1)
at 
i_am_a_horse_in_the_land_of_booleans_test$eval6257.invoke(i_am_a_horse_in_the_land_of_booleans_test.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6619)
at clojure.lang.Compiler.eval(Compiler.java:6608)
at clojure.lang.Compiler.load(Compiler.java:7064)
at clojure.lang.RT.loadResourceScript(RT.java:370)
at clojure.lang.RT.loadResourceScript(RT.java:361)
at clojure.lang.RT.load(RT.java:440)
at clojure.lang.RT.load(RT.java:411)
at clojure.core$load$fn__5018.invoke(core.clj:5530)
at clojure.core$load.doInvoke(core.clj:5529)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5336)
at clojure.core$load_lib$fn__4967.invoke(core.clj:5375)
at clojure.core$load_lib.doInvoke(core.clj:5374)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:619)
at clojure.core$load_libs.doInvoke(core.clj:5413)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:619)
at clojure.core$require.doInvoke(core.clj:5496)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at midje.repl$load_facts$fn__6191.invoke(repl.clj:206)
at midje.repl$load_facts.doInvoke(repl.clj:192)
at clojure.lang.RestFn.invoke(RestFn.java:397)
at user$eval6253.invoke(form-init263954278555209649.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6619)
at clojure.lang.Compiler.eval(Compiler.java:6609)
at clojure.lang.Compiler.load(Compiler.java:7064)
at clojure.lang.Compiler.loadFile(Compiler.java:7020)
at clojure.main$load_script.invoke(main.clj:294)
at clojure.main$init_opt.invoke(main.clj:299)
at clojure.main$initialize.invoke(main.clj:327)
at clojure.main$null_opt.invoke(main.clj:362)
at clojure.main$main.doInvoke(main.clj:440)
at clojure.lang.RestFn.invoke(RestFn.ja

Re: boolean problem

2014-04-17 Thread Stanislas Nanchen
Hello,

You miss one parentheses at the end of your expression

(defn boolean [x]
  (if (and (nil? x) (false? x))
  ))

cheers,
stan.

On Thursday, April 17, 2014 9:11:13 AM UTC+2, Roelof Wobben wrote:
>
> Hello, 
>
> IM working at the Iloveponies github tutorial and Im stuck here,
>
> I have to check if x is a nil or false and then the output must be false,\
> Otherwise I have to be true.
>
> So I tried this :
>
> (defn boolean [x]
>   (if (and (nil? x) (false? x))
>   )
>
> But then I see a very long error message: 
>
> xception in thread "main" java.lang.RuntimeException: EOF while reading, 
> starting at line 4, 
> compiling:(i_am_a_horse_in_the_land_of_booleans.clj:30:1)
> at clojure.lang.Compiler.load(Compiler.java:7071)
> at clojure.lang.RT.loadResourceScript(RT.java:370)
> at clojure.lang.RT.loadResourceScript(RT.java:361)
> at clojure.lang.RT.load(RT.java:440)
> at clojure.lang.RT.load(RT.java:411)
> at clojure.core$load$fn__5018.invoke(core.clj:5530)
> at clojure.core$load.doInvoke(core.clj:5529)
> at clojure.lang.RestFn.invoke(RestFn.java:408)
> at clojure.core$load_one.invoke(core.clj:5336)
> at clojure.core$load_lib$fn__4967.invoke(core.clj:5375)
> at clojure.core$load_lib.doInvoke(core.clj:5374)
> at clojure.lang.RestFn.applyTo(RestFn.java:142)
> at clojure.core$apply.invoke(core.clj:619)
> at clojure.core$load_libs.doInvoke(core.clj:5413)
> at clojure.lang.RestFn.applyTo(RestFn.java:137)
> at clojure.core$apply.invoke(core.clj:621)
> at clojure.core$use.doInvoke(core.clj:5507)
> at clojure.lang.RestFn.invoke(RestFn.java:421)
> at 
> iloveponies.tests.i_am_a_horse_in_the_land_of_booleans$eval6263$loading__4910__auto6264.invoke(i_am_a_horse_in_the_land_of_booleans.clj:1)
> at 
> iloveponies.tests.i_am_a_horse_in_the_land_of_booleans$eval6263.invoke(i_am_a_horse_in_the_land_of_booleans.clj:1)
> at clojure.lang.Compiler.eval(Compiler.java:6619)
> at clojure.lang.Compiler.eval(Compiler.java:6608)
> at clojure.lang.Compiler.load(Compiler.java:7064)
> at clojure.lang.RT.loadResourceScript(RT.java:370)
> at clojure.lang.RT.loadResourceScript(RT.java:361)
> at clojure.lang.RT.load(RT.java:440)
> at clojure.lang.RT.load(RT.java:411)
> at clojure.core$load$fn__5018.invoke(core.clj:5530)
> at clojure.core$load.doInvoke(core.clj:5529)
> at clojure.lang.RestFn.invoke(RestFn.java:408)
> at clojure.core$load_one.invoke(core.clj:5336)
> at clojure.core$load_lib$fn__4967.invoke(core.clj:5375)
> at clojure.core$load_lib.doInvoke(core.clj:5374)
> at clojure.lang.RestFn.applyTo(RestFn.java:142)
> at clojure.core$apply.invoke(core.clj:619)
> at clojure.core$load_libs.doInvoke(core.clj:5413)
> at clojure.lang.RestFn.applyTo(RestFn.java:137)
> at clojure.core$apply.invoke(core.clj:621)
> at clojure.core$use.doInvoke(core.clj:5507)
> at clojure.lang.RestFn.invoke(RestFn.java:408)
> at 
> i_am_a_horse_in_the_land_of_booleans_test$eval6257$loading__4910__auto6258.invoke(i_am_a_horse_in_the_land_of_booleans_test.clj:1)
> at 
> i_am_a_horse_in_the_land_of_booleans_test$eval6257.invoke(i_am_a_horse_in_the_land_of_booleans_test.clj:1)
> at clojure.lang.Compiler.eval(Compiler.java:6619)
> at clojure.lang.Compiler.eval(Compiler.java:6608)
> at clojure.lang.Compiler.load(Compiler.java:7064)
> at clojure.lang.RT.loadResourceScript(RT.java:370)
> at clojure.lang.RT.loadResourceScript(RT.java:361)
> at clojure.lang.RT.load(RT.java:440)
> at clojure.lang.RT.load(RT.java:411)
> at clojure.core$load$fn__5018.invoke(core.clj:5530)
> at clojure.core$load.doInvoke(core.clj:5529)
> at clojure.lang.RestFn.invoke(RestFn.java:408)
> at clojure.core$load_one.invoke(core.clj:5336)
> at clojure.core$load_lib$fn__4967.invoke(core.clj:5375)
> at clojure.core$load_lib.doInvoke(core.clj:5374)
> at clojure.lang.RestFn.applyTo(RestFn.java:142)
> at clojure.core$apply.invoke(core.clj:619)
> at clojure.core$load_libs.doInvoke(core.clj:5413)
> at clojure.lang.RestFn.applyTo(RestFn.java:137)
> at clojure.core$apply.invoke(core.clj:619)
> at clojure.core$require.doInvoke(core.clj:5496)
> at clojure.lang.RestFn.invoke(RestFn.java:421)
> at midje.repl$load_facts$fn__6191.invoke(repl.clj:206)
> at midje.repl$load_facts.doInvoke(repl.clj:192)
> at clojure.lang.RestFn.invoke(RestFn.java:397)
> at user$eval6253.invoke(form-init263954278555209649.clj:1)
> at clojure.lang.Compiler.eval(Compiler.java:6619)
> at clojure.lang.Compiler.eval(Compiler.java:6609)
> at clojure.lang.Compiler.load(Compiler.java:7064)
> 

Need HTTP Client not to verify cert on Heroku

2014-04-17 Thread Glen Mailer
The option you need is ":insecure? true" - although it's worth considering if 
you'd be better off setting up the certificate chain with the appropriate CA 
for the service in question (see trust store section in readme)

-- 
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: boolean problem

2014-04-17 Thread James Trunk
Hi Roelof,

I'd recommend using an editor that supports rainbow brackets so you can 
easily see when your parens are matched.

Also, when you get your parens matched you'll find another error in your 
code, check out the docs for if 
to figure that one out.

Cheers, 
James

On Thursday, April 17, 2014 9:11:13 AM UTC+2, Roelof Wobben wrote:
>
> Hello, 
>
> IM working at the Iloveponies github tutorial and Im stuck here,
>
> I have to check if x is a nil or false and then the output must be false,\
> Otherwise I have to be true.
>
> So I tried this :
>
> (defn boolean [x]
>   (if (and (nil? x) (false? x))
>   )
>
> But then I see a very long error message: 
>
> xception in thread "main" java.lang.RuntimeException: EOF while reading, 
> starting at line 4, 
> compiling:(i_am_a_horse_in_the_land_of_booleans.clj:30:1)
> at clojure.lang.Compiler.load(Compiler.java:7071)
> at clojure.lang.RT.loadResourceScript(RT.java:370)
> at clojure.lang.RT.loadResourceScript(RT.java:361)
> at clojure.lang.RT.load(RT.java:440)
> at clojure.lang.RT.load(RT.java:411)
> at clojure.core$load$fn__5018.invoke(core.clj:5530)
> at clojure.core$load.doInvoke(core.clj:5529)
> at clojure.lang.RestFn.invoke(RestFn.java:408)
> at clojure.core$load_one.invoke(core.clj:5336)
> at clojure.core$load_lib$fn__4967.invoke(core.clj:5375)
> at clojure.core$load_lib.doInvoke(core.clj:5374)
> at clojure.lang.RestFn.applyTo(RestFn.java:142)
> at clojure.core$apply.invoke(core.clj:619)
> at clojure.core$load_libs.doInvoke(core.clj:5413)
> at clojure.lang.RestFn.applyTo(RestFn.java:137)
> at clojure.core$apply.invoke(core.clj:621)
> at clojure.core$use.doInvoke(core.clj:5507)
> at clojure.lang.RestFn.invoke(RestFn.java:421)
> at 
> iloveponies.tests.i_am_a_horse_in_the_land_of_booleans$eval6263$loading__4910__auto6264.invoke(i_am_a_horse_in_the_land_of_booleans.clj:1)
> at 
> iloveponies.tests.i_am_a_horse_in_the_land_of_booleans$eval6263.invoke(i_am_a_horse_in_the_land_of_booleans.clj:1)
> at clojure.lang.Compiler.eval(Compiler.java:6619)
> at clojure.lang.Compiler.eval(Compiler.java:6608)
> at clojure.lang.Compiler.load(Compiler.java:7064)
> at clojure.lang.RT.loadResourceScript(RT.java:370)
> at clojure.lang.RT.loadResourceScript(RT.java:361)
> at clojure.lang.RT.load(RT.java:440)
> at clojure.lang.RT.load(RT.java:411)
> at clojure.core$load$fn__5018.invoke(core.clj:5530)
> at clojure.core$load.doInvoke(core.clj:5529)
> at clojure.lang.RestFn.invoke(RestFn.java:408)
> at clojure.core$load_one.invoke(core.clj:5336)
> at clojure.core$load_lib$fn__4967.invoke(core.clj:5375)
> at clojure.core$load_lib.doInvoke(core.clj:5374)
> at clojure.lang.RestFn.applyTo(RestFn.java:142)
> at clojure.core$apply.invoke(core.clj:619)
> at clojure.core$load_libs.doInvoke(core.clj:5413)
> at clojure.lang.RestFn.applyTo(RestFn.java:137)
> at clojure.core$apply.invoke(core.clj:621)
> at clojure.core$use.doInvoke(core.clj:5507)
> at clojure.lang.RestFn.invoke(RestFn.java:408)
> at 
> i_am_a_horse_in_the_land_of_booleans_test$eval6257$loading__4910__auto6258.invoke(i_am_a_horse_in_the_land_of_booleans_test.clj:1)
> at 
> i_am_a_horse_in_the_land_of_booleans_test$eval6257.invoke(i_am_a_horse_in_the_land_of_booleans_test.clj:1)
> at clojure.lang.Compiler.eval(Compiler.java:6619)
> at clojure.lang.Compiler.eval(Compiler.java:6608)
> at clojure.lang.Compiler.load(Compiler.java:7064)
> at clojure.lang.RT.loadResourceScript(RT.java:370)
> at clojure.lang.RT.loadResourceScript(RT.java:361)
> at clojure.lang.RT.load(RT.java:440)
> at clojure.lang.RT.load(RT.java:411)
> at clojure.core$load$fn__5018.invoke(core.clj:5530)
> at clojure.core$load.doInvoke(core.clj:5529)
> at clojure.lang.RestFn.invoke(RestFn.java:408)
> at clojure.core$load_one.invoke(core.clj:5336)
> at clojure.core$load_lib$fn__4967.invoke(core.clj:5375)
> at clojure.core$load_lib.doInvoke(core.clj:5374)
> at clojure.lang.RestFn.applyTo(RestFn.java:142)
> at clojure.core$apply.invoke(core.clj:619)
> at clojure.core$load_libs.doInvoke(core.clj:5413)
> at clojure.lang.RestFn.applyTo(RestFn.java:137)
> at clojure.core$apply.invoke(core.clj:619)
> at clojure.core$require.doInvoke(core.clj:5496)
> at clojure.lang.RestFn.invoke(RestFn.java:421)
> at midje.repl$load_facts$fn__6191.invoke(repl.clj:206)
> at midje.repl$load_facts.doInvoke(repl.clj:192)
> at clojure.lang.RestFn.invoke(RestFn.java:397)
> at user$eval6253.invoke(form-init263954278555209

Re: boolean problem

2014-04-17 Thread Tassilo Horn
Stanislas Nanchen  writes:

> You miss one parentheses at the end of your expression
>
> (defn boolean [x]
>   (if (and (nil? x) (false? x))
>   ))

And now you have an if without then which will give you another
exception.  And the test expression is a contradiction, i.e., it's
always false.  Nothing can be both nil? and false?.

> I have to check if x is a nil or false and then the output must be
> false,\ Otherwise I have to be true.

Why?  nil and false are already falsy, everything else is true.  And if
you have to interact with java where some method wants some "real"
boolean, then there's already clojure.core/boolean.

Bye,
Tassilo

-- 
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: boolean problem

2014-04-17 Thread Roelof Wobben


Op donderdag 17 april 2014 09:34:52 UTC+2 schreef Tassilo Horn:
>
> Stanislas Nanchen > writes: 
>
> > You miss one parentheses at the end of your expression 
> > 
> > (defn boolean [x] 
> >   (if (and (nil? x) (false? x)) 
> >   )) 
>
> And now you have an if without then which will give you another 
> exception.  And the test expression is a contradiction, i.e., it's 
> always false.  Nothing can be both nil? and false?. 
>

You are right. Stupid thinking error of me. 
 

>
> > I have to check if x is a nil or false and then the output must be 
> > false,\ Otherwise I have to be true. 
>
> Why?  nil and false are already falsy, everything else is true.  And if 
> you have to interact with java where some method wants some "real" 
> boolean, then there's already clojure.core/boolean. 
>
>
In this exercise you are not allowed to use boolean.

Roelof
 

> Bye, 
> Tassilo 
>

-- 
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: boolean problem

2014-04-17 Thread Tassilo Horn
Roelof Wobben  writes:

Hi Roelof,

>> > I have to check if x is a nil or false and then the output must be 
>> > false,\ Otherwise I have to be true. 
>>
>> Why?  nil and false are already falsy, everything else is true.  And
>> if you have to interact with java where some method wants some "real"
>> boolean, then there's already clojure.core/boolean.
>
> In this exercise you are not allowed to use boolean.

Ah, ok, then it makes sense. :-)

Bye,
Tassilo

-- 
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: Light table

2014-04-17 Thread Luc Prefontaine
I have been using Eclipse for the last
10 years roughly. Having a polyglot
project made this choice obvious.

Now that our code base is in Clojure
at 99%, I do not feel tempted by emacs.

May give a try with LightTable
however.

I used to do most of my editing with
emacs in the 1980s, using the first
version written in Teco on tops-20.

In these times it was a vast improvement on line by line editing.

But I can't get back to it, the keyboard
shortcuts do not seem to fit in my
brain anymore. Years of WYSIWYG
probably shrank this brain function
to a bare minimum :)

Luc P.


> 
> On Apr 16, 2014, at 10:48 PM, Mikera  wrote:
> 
> > On Thursday, 17 April 2014 03:57:56 UTC+8, Mike Haney wrote:
> >> The conventional wisdom seems to be that you will end up learning emacs 
> >> eventually if you spend any amount of time doing clojure or lisp, so you 
> >> might as well learn it from the start.  That is definitely the approach 
> >> taken in the braveclojure book, and he may be right, but I have no regrets 
> >> starting with lighttable.
> > 
> > As a counter-example to the "conventional wisdom", I have never really used 
> > Emacs and I've being doing Clojure successfully for around 4 years now. I'm 
> > sure Emacs is great for those who have taken the time to master it, but it 
> > certainly isn't necessary to be productive in Clojure.
> > 
> > I personally use Counterclockwise - this is mainly because I also do a lot 
> > of Java work in Eclipse and it makes the polyglot integration much easier 
> > if you aren't switching tools all the time.
> > 
> > I'm also quite excited about the potential of things like Session or 
> > Gorilla-REPL for exploratory / data science work. I like the way that the 
> > Clojure ecosystem is developing a lot of innovative, plug-able components 
> > and tools that enable different development styles.
> 
> A different kind of counter-example: I've used emacs a fair bit in my decades 
> of Lisping and now years of Clojuring, but I now too use Counterclockwise.
> 
> IMHO emacs has tremendous and beautiful power but unnecessarily awful 
> usability characteristics. I hope that some day someone will develop a 
> Clojure environment with the former but without the later, possibly driven by 
> emacs under the hood.
> 
>  -Lee 
> 
> -- 
> 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.
> 
--
Luc Prefontaine sent by ibisMail!

-- 
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: Light table

2014-04-17 Thread Walter van der Laan
I recently moved from Emacs to Light Table for Clojurescript and I like 
working with it. I created a tutorial that outlines my Clojurescript 
workflow using Light Table: github.com/wvdlaan/todomvc

For my work on the JVM I still use Emacs because old habits die hard. But I 
expect to move to Light Table at some point.

On Wednesday, April 16, 2014 9:42:40 PM UTC+2, Roelof Wobben wrote:
>
> Has anyone tried Light table as a IDE instead of Emacs ?
>
> Roelof
>
>

-- 
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: Why I'm giving Clojure a try

2014-04-17 Thread Manuel Paccagnella


Il giorno mercoledì 16 aprile 2014 18:06:57 UTC+2, Massimiliano Tomassoli 
ha scritto:

I can see the value of having such a regular syntax (or absence of it) but 
> it takes a while to get comfortable with it.
>
I’ve personally found that after a while they don’t bother you anymore :)

[image: LISP Parenthesis]

Having said that, an editor that is LISP-aware and gives you structural 
editing (like Emacs or LightTable, which Paredit support is less advanced 
right now) is a great help. 

-- 
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: boolean problem

2014-04-17 Thread Michael Gardner
On Apr 17, 2014, at 02:34 , Tassilo Horn  wrote:

> And now you have an if without then which will give you another
> exception.

Not true. It's more common to use 'when', but single-branch ifs are perfectly 
fine.

-- 
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: Why I'm giving Clojure a try

2014-04-17 Thread Massimiliano Tomassoli
On Thursday, April 17, 2014 2:17:13 AM UTC+2, Zhemin Lin wrote:
>
> Hi Massimiliano,
> You may also want to give ClojureScript or LiveScript (which compiles to 
> JavaScript and run on node.js) a try!
> LiveScript is quite functional and the callback hell is somewhat eased.
>

Well, ClojureScript is the main reason why I'm studying Clojure right now. 
LiveScript looks interesting, but I've made up my mind: I'll learn my first 
Lisp dialect!
One of the things I miss from Scala and Haskell, and wish were present in 
Clojure, is pattern matching. I'll have a look at core.match hoping it's 
mature enough.

-- 
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: Light table

2014-04-17 Thread Roelof Wobben
Thanks all.

Unfortunally I cannot get Lighttable work.
I work with Nixos where all the packages are stored  in 
/var/store/nixos/ instead of the way linux does these things.
So untill I find out how to compile it from source no Light Table for me.

Roelof


Op donderdag 17 april 2014 10:34:58 UTC+2 schreef Walter van der Laan:
>
> I recently moved from Emacs to Light Table for Clojurescript and I like 
> working with it. I created a tutorial that outlines my Clojurescript 
> workflow using Light Table: github.com/wvdlaan/todomvc
>
> For my work on the JVM I still use Emacs because old habits die hard. But 
> I expect to move to Light Table at some point.
>
> On Wednesday, April 16, 2014 9:42:40 PM UTC+2, Roelof Wobben wrote:
>>
>> Has anyone tried Light table as a IDE instead of Emacs ?
>>
>> Roelof
>>
>>

-- 
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] Sente - Clojure(Script) + core.async + WebSockets/Ajax

2014-04-17 Thread Peter Taoussanis
For those that might be following, have pushed `v0.10.0` so 
long: https://github.com/ptaoussanis/sente/releases/tag/v0.10.0

The server-side `make-channel-socket!` fn's return value now includes a 
`:connected-uids` atom key. You can deref that to get a realtime snapshot 
of all connected user-ids, or you can attach a watch to get notified of any 
changes as they happen.

This makes something like a "who's online now" trivial, and is a good 
foundation for higher-order stuff like subscriptions, etc.

Also updated the reference example to show how one would use this for a 
simple broadcast.

-- 
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: boolean problem

2014-04-17 Thread Roelof Wobben


Op donderdag 17 april 2014 13:26:35 UTC+2 schreef Michael Gardner:
>
> On Apr 17, 2014, at 02:34 , Tassilo Horn > 
> wrote: 
>
> > And now you have an if without then which will give you another 
> > exception. 
>

Yep, but that one I solved already.
 

>
> Not true. It's more common to use 'when', but single-branch ifs are 
> perfectly fine.

-- 
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: Why I'm giving Clojure a try

2014-04-17 Thread Angel Java Lopez
Hi Massimiliano!

I read you at Scala list. Short comment: there is a clojurescript
googlegroup, too.

Angel "Java" Lopez
@ajlopez


On Thu, Apr 17, 2014 at 8:31 AM, Massimiliano Tomassoli
wrote:

> On Thursday, April 17, 2014 2:17:13 AM UTC+2, Zhemin Lin wrote:
>>
>> Hi Massimiliano,
>> You may also want to give ClojureScript or LiveScript (which compiles to
>> JavaScript and run on node.js) a try!
>> LiveScript is quite functional and the callback hell is somewhat eased.
>>
>
> Well, ClojureScript is the main reason why I'm studying Clojure right now.
> LiveScript looks interesting, but I've made up my mind: I'll learn my first
> Lisp dialect!
> One of the things I miss from Scala and Haskell, and wish were present in
> Clojure, is pattern matching. I'll have a look at core.match hoping it's
> mature enough.
>
> --
> 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: Why I'm giving Clojure a try

2014-04-17 Thread Mars0i
Thanks for that image, Manuel Paccagnella.  I'd never seen it.
However, the top image leaves out most of the parentheses, and they're part 
of the beauty, for me--along with the indentation.

(I had a little bit of trouble Googling up a stable URL for the image, but 
finally found this, for anyone who wants it: 
http://img264.imageshack.us/img264/1397/lispnd7.png)

-- 
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: Why I'm giving Clojure a try

2014-04-17 Thread Massimiliano Tomassoli
On Thursday, April 17, 2014 2:19:48 PM UTC+2, ajlopez wrote:
>
> Hi Massimiliano!
>
> I read you at Scala list.
>

Hi, I remember you :)
 

> Short comment: there is a clojurescript googlegroup, too.
>

Thanks, I didn't know that!

-- 
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 namespace per session in nREPL

2014-04-17 Thread Arkadiusz Komarzewski
Hello,

I would like to let multiple users use single nrepl server. One problem I 
noticed is that after connecting you are by default put in 'user' 
namespace. I am looking for a way to configure nrepl server in a way it 
will assign new namespace (let's say random-generated) for each session.

Are there any existing solutions for that?

So far I (after browsing nrepl source) I think I would have to write my own 
session middleware, which would handle creation of new namespaces per 
session. Is this the correct approach?

Cheers,
Arek

-- 
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: boolean problem

2014-04-17 Thread Tassilo Horn
Michael Gardner  writes:

>> And now you have an if without then which will give you another
>> exception.
>
> Not true. It's more common to use 'when', but single-branch ifs are
> perfectly fine.

Yes, but that was a zero-branch if, and that's not ok.

Bye,
Tassilo

-- 
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: boolean problem

2014-04-17 Thread Michael Gardner
On Apr 17, 2014, at 07:38 , Tassilo Horn  wrote:

> Michael Gardner  writes:
> 
>>> And now you have an if without then which will give you another
>>> exception.
>> 
>> Not true. It's more common to use 'when', but single-branch ifs are
>> perfectly fine.
> 
> Yes, but that was a zero-branch if, and that's not ok.

Oh duh, my bad. I read that as "if without else" for some reason. Sorry for the 
noise.

-- 
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] 3T Software Labs MongoDB tools for CongoMongo and Monger users.

2014-04-17 Thread graham


Hello fair Clojarians!

I’d like to announce the availability of 3T Software Labs MongoDB tools to 
the CongoMongo and Monger users (and any other MongoDB users) on this list.

To forward-thinking Clojarians and MongoDB users alike, I’d like to extend 
a special 60-day trial of all the apps in our suite at 
http://3tsoftwarelabs.com/evaluation-edition using the code ‘CLJR’.

My apologies for the spam if you’re not a CongoMongo / Monger / MongoDB 
user.

If you are, I hope you enjoy our tools and find them useful.

Like many of the pioneering Clojure projects described on this list, we’ve 
just started our adventure, and would love to hear any feedback you have.


Thanks a lot,

Graham

3T Software Labs

-- 
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: Thoughts on bags?

2014-04-17 Thread Greg D
While searching for MultiSet or Bag resources, I found this implementation 
by Achim Passen at: A simple multiset/bag implementation for 
Clojure
.

However, I found I could meet my needs by adding functions to treat 
vectors, or other collection types, as unordered.

For the hash, from Clojure Data 
Structures
:

(defn hash-unordered [collection]
  (-> (reduce unchecked-add-int 0 (map hash collection))
  (mix-collection-hash (count collection


For equality:
(defn equals-unordered [coll-a coll-b]
  "Treat collections as unordered for 1st level of comparison."
  (or (identical? coll-a coll-b)
  (and (empty? coll-a) (empty? coll-b))
  (let [set-a (set coll-a)
set-b (set coll-b)]
(and (= set-a set-b)
 (loop [[item & items] (seq set-a)]
   (let [finder #(= item %)
 found-a (filter finder coll-a)
 found-b (filter finder coll-b)]
 (if (not= (count found-a) (count found-b))
   false
   (if (empty? items)
 true
 (recur items)

Neither Achim's deftype, nor the above, is likely as efficient as a core 
collection MultiSet. In the meantime, I hope these observations are useful.

Greg

-- 
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 Cons in iterate's return value

2014-04-17 Thread A. Webb


On Wednesday, April 16, 2014 10:35:14 PM UTC-5, Mars0i wrote:
>
>
> But then should realized? be able to deal with a Cons containing a LazySeq?
>
> (Is this an issue worthy of JIRA? I've never submitted there, and am not 
> sure I know enough to do so.  Willing to try to figure it out.)
>

No, realized? works as intended on a single object. If you want to know if 
there is an unrealized portion remaining of a sequence, just roll your own 
function to step through it, being careful not to force realization of 
unrealized portions while doing so. Untested example:

(defn seq-realized? 
  "Returns false if there is an unrealized tail in the sequence,
  otherwise true."
  [s] 
  (if (instance? clojure.lang.IPending s) 
(if (realized? s) 
  (if (seq s) 
(recur (rest s)) 
true) 
  false) 
(if (seq s) 
  (recur (rest s)) 
  true)))

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


Style question (predicates)

2014-04-17 Thread Sean Corfield
The library coding standards[1] say:

* Use '?' suffix for predicates.
  - N.B. - predicates return booleans

and the community Clojure style guide[2] says:

* The names of predicate methods (methods that return a boolean value) should 
end in a question mark. (i.e.even?).

Both of these imply that if you have a function that returns a boolean (and 
that is intended for use as a predicate), it should be named to end in '?'. 
Fair enough.

My question is about the reverse implication:

* Should a function whose name ends in '?' return a (strict) boolean value?

Looking at the docstrings of a random selection of functions found by (apropos 
"?"), they all seem to return specifically true or false. I did not do an 
exhaustive check.

Is the intent that foo? implies a result of true or false - or could foo? 
return any truthy / falsey value (and therefore any Clojure value).

Concrete example that spurred this discussion from some code at work:

(defn is-nsf-code?
  "Given an error code, return truthy if it is NSF."
  [code]
  (#{"BE1" "BE2"} code))

Clearly the result here could be nil or a string but it's definitely meant to 
be used as a predicate. Similarly:

(defn nsf?
  "Given the result of an SBW sale, return true if it failed with NSF."
  [result]
  (and (= "failure" (:result result))
   (some is-nsf-code? (:errors result

Again, the result could be false or nil or a string but is meant to be used as 
a predicate.

As an aside, for core.typed, we annotate the first as [String -> Boolean] with 
^:no-check so it type checks as a true/false predicate and then we annotate the 
second as [SBWResult -> (Nilable Boolean)] and that's all fine... but is it 
"good style"?

[1] http://dev.clojure.org/display/community/Library+Coding+Standards
[2] https://github.com/bbatsov/clojure-style-guide#naming

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

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





signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: is there a way I can learn clojure with a lot of exercises

2014-04-17 Thread Erlis Vidal
Also you can check
http://readwrite.com/2011/07/01/free-e-books-on-clojure#awesm=~oBIfFVbGUOK34e


On Thu, Apr 17, 2014 at 2:33 AM, Gary Verhaegen wrote:

> Hi Roelof,
>
> I noticed your chat client is in Dutch. On the off chance that you might
> be in Flanders, I wanted to point out that there is going to be a BeClojure
> meetup on 2014-04-23 in Antwerp. More details:
> http://clojuregroup.org/2014/04/11/invitation-beclojure-23-april-2014-antwerpen/
>
>
> On Wednesday, 16 April 2014, Roelof Wobben  wrote:
>
>>
>>
>> Op woensdag 16 april 2014 16:43:09 UTC+2 schreef Charlie Griefer:
>>>
>>>
>>> On Apr 15, 2014, at 11:56 PM, Roelof Wobben  wrote:
>>>
>>> I like to try clojure.
>>> I have little or none programming background but I know I learn the best
>>> by reading a piece of text
>>> and then do exercises about it so I can check if I really understand it.
>>>
>>> What is then the best way to proceed ?
>>>
>>>
>>> I know you said that you want to do exercises, but I have to second the
>>> recommendations for Clojure for the Brave and True. Great introduction for
>>> somebody who has little to no programming background. http://www.
>>> braveclojure.com/
>>>
>>> Also as others have said, 4Clojure is exactly what you're asking for
>>> (exercises). But I'd start off with Clojure for the Brave and True, and as
>>> concepts start to click (or maybe even just before that), start working
>>> some of the 4Clojure exercises.
>>>
>>> --
>>> Charlie Griefer
>>> http://charlie.griefer.com
>>>
>>> "Give light, and the darkness will disappear of itself."
>>> -- Desiderius Erasmus
>>>
>>>
>>
>> Thanks,
>>
>> What I do now is read the braveclojure book and do the exercises from
>> http://iloveponies.github.io/120-hour-epic-sax-marathon/index.html
>>
>> So I read a lot and I can see how things work.
>>
>> Roelof
>>
>>  --
>> 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.


Clojure source releases issue for Maven Central

2014-04-17 Thread Jeff Valk
Current builds of the Clojure "sources" jar (clojure-1.6.0-sources.jar, 
clojure-1.5.1-sources.jar, etc) available from the Maven Central "releases" 
repository contain the errant "versions.properties" file noted in issue 
CLJ-1161 [1] . The fix for that issue can be seen in the Central repo 
labelled "clojure-1239" (staging?), but not in "releases":

OK:  clojure-1239  001918a4c1e544a66d4bc6c84429694d  
clojure-1.6.0-sources.jar [2]
Bad: releases  1c03eec13fbd86083230c3e97ea5bab7  
clojure-1.6.0-sources.jar [3]

Could someone who is more familiar with the Clojure build/upload process 
shed some light on this?

Cheers,
Jeff


[1] http://dev.clojure.org/jira/browse/CLJ-1161
[2] 
https://oss.sonatype.org/index.html#view-repositories;orgclojure-1239~browsestorage~/org/clojure/clojure/1.6.0/clojure-1.6.0-sources.jar
[3] 
https://oss.sonatype.org/index.html#view-repositories;releases~browsestorage~/org/clojure/clojure/1.6.0/clojure-1.6.0-sources.jar

-- 
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: Light table

2014-04-17 Thread Roelof Wobben
It seems that Nightcode works

What do you experts think of this IDE.

Roelof


Op donderdag 17 april 2014 13:39:31 UTC+2 schreef Roelof Wobben:

> Thanks all.
>
> Unfortunally I cannot get Lighttable work.
> I work with Nixos where all the packages are stored  in 
> /var/store/nixos/ instead of the way linux does these things.
> So untill I find out how to compile it from source no Light Table for me.
>
> Roelof
>
>
> Op donderdag 17 april 2014 10:34:58 UTC+2 schreef Walter van der Laan:
>>
>> I recently moved from Emacs to Light Table for Clojurescript and I like 
>> working with it. I created a tutorial that outlines my Clojurescript 
>> workflow using Light Table: github.com/wvdlaan/todomvc
>>
>> For my work on the JVM I still use Emacs because old habits die hard. But 
>> I expect to move to Light Table at some point.
>>
>> On Wednesday, April 16, 2014 9:42:40 PM UTC+2, Roelof Wobben wrote:
>>>
>>> Has anyone tried Light table as a IDE instead of Emacs ?
>>>
>>> Roelof
>>>
>>>

-- 
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: Style question (predicates)

2014-04-17 Thread Colin Yates
My 2p - I interpret the contract as being boolean.  Truthy values are 
'polymorphically' equivalent*1 so sure.  The concern would be people 
relying on the implementation and treating the values as none-truthy (i.e. 
in your example relying on the fact it is a string being returned, so (= 
"someString" (is-nsf-code? "someString")))

I should reduce it to 1p really as I am only contributing in an abstract 
design sense, not in the specifics of the coding standards you mentioned.

*1 If this doesn't hold (i.e. caller depends upon receiving a 
java.lang.Boolean or associated primitive) then I think the caller has 
bigger problems.

On Thursday, April 17, 2014 5:33:42 PM UTC+1, Sean Corfield wrote:
>
> The library coding standards[1] say: 
>
> * Use '?' suffix for predicates. 
>   - N.B. - predicates return booleans 
>
> and the community Clojure style guide[2] says: 
>
> * The names of predicate methods (methods that return a boolean value) 
> should end in a question mark. (i.e.even?). 
>
> Both of these imply that if you have a function that returns a boolean 
> (and that is intended for use as a predicate), it should be named to end in 
> '?'. Fair enough. 
>
> My question is about the reverse implication: 
>
> * Should a function whose name ends in '?' return a (strict) boolean 
> value? 
>
> Looking at the docstrings of a random selection of functions found by 
> (apropos "?"), they all seem to return specifically true or false. I did 
> not do an exhaustive check. 
>
> Is the intent that foo? implies a result of true or false - or could foo? 
> return any truthy / falsey value (and therefore any Clojure value). 
>
> Concrete example that spurred this discussion from some code at work: 
>
> (defn is-nsf-code? 
>   "Given an error code, return truthy if it is NSF." 
>   [code] 
>   (#{"BE1" "BE2"} code)) 
>
> Clearly the result here could be nil or a string but it's definitely meant 
> to be used as a predicate. Similarly: 
>
> (defn nsf? 
>   "Given the result of an SBW sale, return true if it failed with NSF." 
>   [result] 
>   (and (= "failure" (:result result)) 
>(some is-nsf-code? (:errors result 
>
> Again, the result could be false or nil or a string but is meant to be 
> used as a predicate. 
>
> As an aside, for core.typed, we annotate the first as [String -> Boolean] 
> with ^:no-check so it type checks as a true/false predicate and then we 
> annotate the second as [SBWResult -> (Nilable Boolean)] and that's all 
> fine... but is it "good style"? 
>
> [1] http://dev.clojure.org/display/community/Library+Coding+Standards 
> [2] https://github.com/bbatsov/clojure-style-guide#naming 
>
> Sean Corfield -- (904) 302-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: New namespace per session in nREPL

2014-04-17 Thread Sean Corfield
Since they can move into any namespace they want and they're all sharing the 
same running JVM context, I'm not sure what separate namespaces buys... Can you 
elaborate on your use case?

Sean

On Apr 17, 2014, at 5:35 AM, Arkadiusz Komarzewski  
wrote:
> I would like to let multiple users use single nrepl server. One problem I 
> noticed is that after connecting you are by default put in 'user' namespace. 
> I am looking for a way to configure nrepl server in a way it will assign new 
> namespace (let's say random-generated) for each session.
> 
> Are there any existing solutions for that?
> 
> So far I (after browsing nrepl source) I think I would have to write my own 
> session middleware, which would handle creation of new namespaces per 
> session. Is this the correct approach?




signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: Clojure Office Hours

2014-04-17 Thread Miguel Ping
Hey, the schedule's full! :\

On Wednesday, April 16, 2014 2:57:49 AM UTC+1, Marcus Blankenship wrote:
>
> Leif, thanks for the great session today.  Not only did I get a jump start 
> on my next 4Clojure problems, but I learned some emacs as well!  Very 
> enjoyable, and I look forward to next week’s session.  THANK YOU!
>
> All, if you’re trying to get a jumpstart on Clojure, I highly recommend 
> Leif’s office hours.
>
> -Marcus
>
> On Apr 15, 2014, at 6:50 PM, Leif > 
> wrote:
>
> @Jakub: Thanks for your kind words.  I'm definitely no "industry hero," 
> but I hope Clojure devs of all levels start having more pair programming 
> fun.
>
> @Tim: Clojurescript UI programming being *way* out of my comfort zone, I 
> learned quite a lot from you yesterday.  So thank *you*.
>
> @Everyone:  To clarify / reiterate:  You do *not* need a plan, a project, 
> or a specific problem.  If you want to work through Project Euler, 
> 4clojure, clojure-koans, the ClojureBridge materials, some other clojure 
> tutorial, or just play it by ear, I am happy to try it out.
>
> --Leif
>
> On Tuesday, April 15, 2014 8:00:17 AM UTC-4, frye wrote:
>>
>> I just came from an office hours session, yesterday with Leif. 
>>
>> This is good stuff guys, and a great way to learn and meet with other 
>> developers. Highly recommended. 
>>
>>
>> Thanks Leif 
>>
>> Tim Washington 
>> Interruptsoftware.com  
>>
>>
>> On Tue, Apr 15, 2014 at 5:12 AM, Jakub Holy  wrote:
>>
>>> Hi Leif,
>>>
>>> This is a great activity, thank you for contributing to the community 
>>> this way!
>>>
>>> Do not be surprise and discouraged by the fact that the interest seems 
>>> low. I have a similar experience - in my company we can consult with an 
>>> "industry hero" yet people use the opportunity seldom, presumably because 
>>> of multiple factors: they (wrongly) don't feel that they do not have 
>>> something important/interesting enough to bother him, they are little 
>>> scared of talking to and exposing themselves and their work to this 
>>> experienced guy, and might find it difficult to explain their challenge to 
>>> an outsider and get an advice within the limited time scope. On the other 
>>> hand, those who dare to use the opportunity benefit from it greatly.
>>>
>>> Good luck, Jakub 
>>>
>>>
>>> On Friday, April 11, 2014 4:13:18 AM UTC+2, Leif wrote:

 Hmm... less interest than I'd expected, given recent posts.  Maybe I 
 should rename the thread to "Free Clojure Consulting / Tutoring."  
 Tht's not spammy.

 FYI, all bookings are automatically confirmed, so don't fret if I don't 
 instantly respond.

 @Tim: Sounds good!  Of course, now I'll have to take some time this 
 weekend and try to actually understand Om. :)  (or maybe ?o_0? )

 --Leif

 On Thursday, April 10, 2014 9:56:37 AM UTC-4, frye wrote:
>
> Sounds great. I just sent a request. 
>
> Tim Washington 
>  Interruptsoftware.com  
>
>
> On Thu, Apr 10, 2014 at 9:43 AM, Colin Fleming 
> wrote:
>
>> Hi Leif,
>>
>> This sounds like a very interesting project, please report back and 
>> let us know how it went! I'd be very interested to know.
>>
>> Cheers,
>> Colin
>>
>>
>> On 11 April 2014 00:53, Leif  wrote:
>>
>>> Hi, everybody.  Inspired by the SF Bay Area clojure group, 
>>> ClojureBridge, and the great talks on community education from 
>>> Clojure/West 
>>> on youtube, I've decided to try holding my own personal Clojure office 
>>> hours (online).
>>>
>>> I am personally of the opinion that face-to-face interaction is 
>>> superior, so you may want to get your local user group to follow the 
>>> Bay 
>>> Area's lead.  But if you don't agree, or you don't live near such a 
>>> user 
>>> group, then read on.
>>>
>>> Borrowed from the Bay Area's posting:
>>>
>>> "This is a [2-person] meetup for anyone who is working on a Clojure 
>>> project and wants to talk over their code or approach with an 
>>> experienced 
>>> Clojure developer.
>>>
>>> Projects of all levels and complexity are welcome, anyone just 
>>> getting started in Clojure is encouraged to come in and talk through 
>>> their 
>>> first Euler or 4Clojure problems."
>>> Disclaimer: This community being what it is, there may be projects 
>>> of too high a complexity for me, but I'll give it a shot.
>>>
>>> I'm going to try a test run of this for two weeks, and then I'll 
>>> have to see what state I'm in (mentally and geographically).  If 
>>> interested, you can book at this link:
>>>
>>> https://leifpoorman.youcanbook.me/
>>>
>>> Note: all the times are evening, US Eastern.  That pretty much 
>>> limits it to the western hemisphere and any east asian friends that 
>>> want to 
>>>

project docs

2014-04-17 Thread Brian Craft
Is there a standard workflow, lein plugin, or such, for building/serving a 
project's README.md, doc/*.md, etc.? During development, I mean, to preview 
the docs while working on them.

-- 
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: project docs

2014-04-17 Thread Andrey Antukh
Hi.

Personally I don't know any standard way to document clojure libraries, but
if you want generic documentation tool, asciidoc works very well.

Examples:

http://niwibe.github.io/buddy/
http://niwibe.github.io/django-pgjson/

Greetings.
Andrey



2014-04-17 20:18 GMT+02:00 Brian Craft :

> Is there a standard workflow, lein plugin, or such, for building/serving a
> project's README.md, doc/*.md, etc.? During development, I mean, to preview
> the docs while working on them.
>
> --
> 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.
>



-- 
Andrey Antukh - Андрей Антух -  / 
http://www.niwi.be 
https://github.com/niwibe

-- 
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: Style question (predicates)

2014-04-17 Thread John Wiseman
In the Common Lisp world it's common for predicates to return a useful
value instead of T, when applicable.  It seems possible the same principle
could apply to clojure.

>From CLtL2 :

Often a predicate will return nil if it ``fails'' and some useful value if
it ``succeeds''; such a function can be used not only as a test but also
for the useful value provided in case of success. An example is
member
.





On Thu, Apr 17, 2014 at 10:20 AM, Colin Yates  wrote:

> My 2p - I interpret the contract as being boolean.  Truthy values are
> 'polymorphically' equivalent*1 so sure.  The concern would be people
> relying on the implementation and treating the values as none-truthy (i.e.
> in your example relying on the fact it is a string being returned, so (=
> "someString" (is-nsf-code? "someString")))
>
> I should reduce it to 1p really as I am only contributing in an abstract
> design sense, not in the specifics of the coding standards you mentioned.
>
> *1 If this doesn't hold (i.e. caller depends upon receiving a
> java.lang.Boolean or associated primitive) then I think the caller has
> bigger problems.
>
>
> On Thursday, April 17, 2014 5:33:42 PM UTC+1, Sean Corfield wrote:
>>
>> The library coding standards[1] say:
>>
>> * Use '?' suffix for predicates.
>>   - N.B. - predicates return booleans
>>
>> and the community Clojure style guide[2] says:
>>
>> * The names of predicate methods (methods that return a boolean value)
>> should end in a question mark. (i.e.even?).
>>
>> Both of these imply that if you have a function that returns a boolean
>> (and that is intended for use as a predicate), it should be named to end in
>> '?'. Fair enough.
>>
>> My question is about the reverse implication:
>>
>> * Should a function whose name ends in '?' return a (strict) boolean
>> value?
>>
>> Looking at the docstrings of a random selection of functions found by
>> (apropos "?"), they all seem to return specifically true or false. I did
>> not do an exhaustive check.
>>
>> Is the intent that foo? implies a result of true or false - or could foo?
>> return any truthy / falsey value (and therefore any Clojure value).
>>
>> Concrete example that spurred this discussion from some code at work:
>>
>> (defn is-nsf-code?
>>   "Given an error code, return truthy if it is NSF."
>>   [code]
>>   (#{"BE1" "BE2"} code))
>>
>> Clearly the result here could be nil or a string but it's definitely
>> meant to be used as a predicate. Similarly:
>>
>> (defn nsf?
>>   "Given the result of an SBW sale, return true if it failed with NSF."
>>   [result]
>>   (and (= "failure" (:result result))
>>(some is-nsf-code? (:errors result
>>
>> Again, the result could be false or nil or a string but is meant to be
>> used as a predicate.
>>
>> As an aside, for core.typed, we annotate the first as [String -> Boolean]
>> with ^:no-check so it type checks as a true/false predicate and then we
>> annotate the second as [SBWResult -> (Nilable Boolean)] and that's all
>> fine... but is it "good style"?
>>
>> [1] http://dev.clojure.org/display/community/Library+Coding+Standards
>> [2] https://github.com/bbatsov/clojure-style-guide#naming
>>
>> Sean Corfield -- (904) 302-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.
>

-- 
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: project docs

2014-04-17 Thread Rob Day
If you just want to preview the docs, Emacs has a markdown-mode -
http://jblevins.org/projects/markdown-mode/. I can type C-c C-c p when
editing my README.md, and a properly formatted version comes up in
Firefox.

On 17 April 2014 19:31, Andrey Antukh  wrote:
> Hi.
>
> Personally I don't know any standard way to document clojure libraries, but
> if you want generic documentation tool, asciidoc works very well.
>
> Examples:
>
> http://niwibe.github.io/buddy/
> http://niwibe.github.io/django-pgjson/
>
> Greetings.
> Andrey
>
>
>
> 2014-04-17 20:18 GMT+02:00 Brian Craft :
>
>> Is there a standard workflow, lein plugin, or such, for building/serving a
>> project's README.md, doc/*.md, etc.? During development, I mean, to preview
>> the docs while working on them.
>>
>> --
>> 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.
>
>
>
>
> --
> Andrey Antukh - Андрей Антух -  /
> 
> http://www.niwi.be
> https://github.com/niwibe
>
> --
> 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.



-- 
Robert K. Day
robert@merton.oxon.org

-- 
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: project docs

2014-04-17 Thread Sean Corfield
LightTable has a plugin for live Markdown rendering which I find very useful. 
So useful in fact that I created a plugin for live Textile rendering based on 
it :)

Sean

On Apr 17, 2014, at 11:18 AM, Brian Craft  wrote:
> Is there a standard workflow, lein plugin, or such, for building/serving a 
> project's README.md, doc/*.md, etc.? During development, I mean, to preview 
> the docs while working on them.




signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: The Cons in iterate's return value

2014-04-17 Thread Mars0i


On Thursday, April 17, 2014 10:36:13 AM UTC-5, A. Webb wrote:

> On Wednesday, April 16, 2014 10:35:14 PM UTC-5, Mars0i wrote:
>>
>>
>> But then should realized? be able to deal with a Cons containing a 
>> LazySeq?
>>
>> (Is this an issue worthy of JIRA? I've never submitted there, and am not 
>> sure I know enough to do so.  Willing to try to figure it out.)
>>
>
> No, realized? works as intended on a single object. If you want to know 
> if there is an unrealized portion remaining of a sequence, just roll your 
> own function to step through it, being careful not to force realization of 
> unrealized portions while doing so. Untested example:
>

Very nice--thanks.

But there's still a conflict between the docstrings for iterate and 
realized?, right?  If it's true that iterate "Returns a lazy sequence", 
then it's false that realized? "Returns true if a value has been produced 
for a ... lazy sequence", since it throws an exception on what iteratereturns.

-- 
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: Light table

2014-04-17 Thread Colin Fleming
BTW I changed the website copy a little for Cursive, since much less
bravery is now required than previously. Thanks for the heads up! I'd
forgotten that was still there.


On 17 April 2014 13:12, Mark Engelberg  wrote:

> On Wed, Apr 16, 2014 at 6:01 PM, Colin Fleming <
> colin.mailingl...@gmail.com> wrote:
>
>> Standard disclaimer: I develop Cursive.
>>
>>
> How's Cursive coming along? The website still says it's only for those who
> are "feeling brave".
>
> --
> 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: Style question (predicates)

2014-04-17 Thread Mars0i
While *every?* and *not-any?* return true or false, *some* returns the 
first truthy value in a sequence, or nil if there are none.

Similarly, *empty?* returns true or false, while *empty* and *not-empty*return 
a collection or nil.

However, it seems as if* some*, *empty*, and *not-empty *are intended to be 
used like predicates, as well other ways.  They are predicates in the 
Common Lisp sense.

This makes me think that question marks are supposed to be reserved for 
functions that return booleans.

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


Emacs - error with `nrepl-jack-in'

2014-04-17 Thread Thorsten Jolitz

Hi List, 

just installed lein2 and can start 'lein2 repl' successfully on the
command-line. 'lein repl' works too, since I defined an alias in my
.bashrc. 

After installing packages clojure-mode and nrepl in Emacs, I get this
error when trying `nrepl-jack-in':

,-
| error in process sentinel: Could not start nREPL server: /bin/bash: Line
| 1: lein: Command not found.
`-

I'm on Archlinx with

#+begin_src emacs-lisp
 (emacs-version)
#+end_src

#+results:
: GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.7)
:  of 2014-01-28 on var-lib-archbuild-extra-x86_64-juergen

I googled some related sites and it seems it might be an Emacs (exec-) path
problem, but a reboot did not help.

-- 
cheers,
Thorsten

-- 
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: Clojure Office Hours

2014-04-17 Thread Leif
@Miguel: There are somewhat subtle arrows on the sides for navigation.  
Thursday, April 24 is still open.  I will give a slot to you if you want 
one, just email me if the 24th is full when you check again.

@all: But yes, this round of office hours is almost over.  I will be in 
transit for at least a couple weeks in the beginning of May, but I will 
probably book some more hours when I become stationary again.  It will 
probably be more like 4 or 5 hours a week, though, not 8.

@all: Several poor souls from Europe are going to stay up until 2 a.m. for 
this, and people further east are probably just silent because the time 
difference is so large; So, I definitely think some European / African / 
Asian / Australian clojure devs' office hours would be popular.  It's fun, 
and you might find some people to hire, if that's your thing!

--Leif

On Thursday, April 17, 2014 10:43:50 AM UTC-4, Miguel Ping wrote:
>
> Hey, the schedule's full! :\
>
> On Wednesday, April 16, 2014 2:57:49 AM UTC+1, Marcus Blankenship wrote:
>>
>> Leif, thanks for the great session today.  Not only did I get a jump 
>> start on my next 4Clojure problems, but I learned some emacs as well!  Very 
>> enjoyable, and I look forward to next week’s session.  THANK YOU!
>>
>> All, if you’re trying to get a jumpstart on Clojure, I highly recommend 
>> Leif’s office hours.
>>
>> -Marcus
>>
>> On Apr 15, 2014, at 6:50 PM, Leif  wrote:
>>
>> @Jakub: Thanks for your kind words.  I'm definitely no "industry hero," 
>> but I hope Clojure devs of all levels start having more pair programming 
>> fun.
>>
>> @Tim: Clojurescript UI programming being *way* out of my comfort zone, I 
>> learned quite a lot from you yesterday.  So thank *you*.
>>
>> @Everyone:  To clarify / reiterate:  You do *not* need a plan, a 
>> project, or a specific problem.  If you want to work through Project Euler, 
>> 4clojure, clojure-koans, the ClojureBridge materials, some other clojure 
>> tutorial, or just play it by ear, I am happy to try it out.
>>
>> --Leif
>>
>> On Tuesday, April 15, 2014 8:00:17 AM UTC-4, frye wrote:
>>>
>>> I just came from an office hours session, yesterday with Leif. 
>>>
>>> This is good stuff guys, and a great way to learn and meet with other 
>>> developers. Highly recommended. 
>>>
>>>
>>> Thanks Leif 
>>>
>>> Tim Washington 
>>> Interruptsoftware.com  
>>>
>>>
>>> On Tue, Apr 15, 2014 at 5:12 AM, Jakub Holy  wrote:
>>>
 Hi Leif,

 This is a great activity, thank you for contributing to the community 
 this way!

 Do not be surprise and discouraged by the fact that the interest seems 
 low. I have a similar experience - in my company we can consult with an 
 "industry hero" yet people use the opportunity seldom, presumably because 
 of multiple factors: they (wrongly) don't feel that they do not have 
 something important/interesting enough to bother him, they are little 
 scared of talking to and exposing themselves and their work to this 
 experienced guy, and might find it difficult to explain their challenge to 
 an outsider and get an advice within the limited time scope. On the other 
 hand, those who dare to use the opportunity benefit from it greatly.

 Good luck, Jakub 


 On Friday, April 11, 2014 4:13:18 AM UTC+2, Leif wrote:
>
> Hmm... less interest than I'd expected, given recent posts.  Maybe I 
> should rename the thread to "Free Clojure Consulting / Tutoring."  
> Tht's not spammy.
>
> FYI, all bookings are automatically confirmed, so don't fret if I 
> don't instantly respond.
>
> @Tim: Sounds good!  Of course, now I'll have to take some time this 
> weekend and try to actually understand Om. :)  (or maybe ?o_0? )
>
> --Leif
>
> On Thursday, April 10, 2014 9:56:37 AM UTC-4, frye wrote:
>>
>> Sounds great. I just sent a request. 
>>
>> Tim Washington 
>>  Interruptsoftware.com  
>>
>>
>> On Thu, Apr 10, 2014 at 9:43 AM, Colin Fleming > > wrote:
>>
>>> Hi Leif,
>>>
>>> This sounds like a very interesting project, please report back and 
>>> let us know how it went! I'd be very interested to know.
>>>
>>> Cheers,
>>> Colin
>>>
>>>
>>> On 11 April 2014 00:53, Leif  wrote:
>>>
 Hi, everybody.  Inspired by the SF Bay Area clojure group, 
 ClojureBridge, and the great talks on community education from 
 Clojure/West 
 on youtube, I've decided to try holding my own personal Clojure office 
 hours (online).

 I am personally of the opinion that face-to-face interaction is 
 superior, so you may want to get your local user group to follow the 
 Bay 
 Area's lead.  But if you don't agree, or you don't live near such a 
 user 
 group, then read on.

 

Re: Style question (predicates)

2014-04-17 Thread Zach Oakes
This is a bit tangential, but your function "is-nsf-code?" brings up 
another style question. Is it really necessary to use the "is-" prefix? I 
used to do this too, but I realized recently that it is a Java-ism and 
seems out of place in Clojure.

Clojure's boolean functions do fine without it because the question mark 
conveys the fact that it is boolean. I removed all instances of this prefix 
from my active projects, including many places in Nightcode and a few in 
play-clj.

On Thursday, April 17, 2014 12:33:42 PM UTC-4, Sean Corfield wrote:
>
> The library coding standards[1] say: 
>
> * Use '?' suffix for predicates. 
>   - N.B. - predicates return booleans 
>
> and the community Clojure style guide[2] says: 
>
> * The names of predicate methods (methods that return a boolean value) 
> should end in a question mark. (i.e.even?). 
>
> Both of these imply that if you have a function that returns a boolean 
> (and that is intended for use as a predicate), it should be named to end in 
> '?'. Fair enough. 
>
> My question is about the reverse implication: 
>
> * Should a function whose name ends in '?' return a (strict) boolean 
> value? 
>
> Looking at the docstrings of a random selection of functions found by 
> (apropos "?"), they all seem to return specifically true or false. I did 
> not do an exhaustive check. 
>
> Is the intent that foo? implies a result of true or false - or could foo? 
> return any truthy / falsey value (and therefore any Clojure value). 
>
> Concrete example that spurred this discussion from some code at work: 
>
> (defn is-nsf-code? 
>   "Given an error code, return truthy if it is NSF." 
>   [code] 
>   (#{"BE1" "BE2"} code)) 
>
> Clearly the result here could be nil or a string but it's definitely meant 
> to be used as a predicate. Similarly: 
>
> (defn nsf? 
>   "Given the result of an SBW sale, return true if it failed with NSF." 
>   [result] 
>   (and (= "failure" (:result result)) 
>(some is-nsf-code? (:errors result 
>
> Again, the result could be false or nil or a string but is meant to be 
> used as a predicate. 
>
> As an aside, for core.typed, we annotate the first as [String -> Boolean] 
> with ^:no-check so it type checks as a true/false predicate and then we 
> annotate the second as [SBWResult -> (Nilable Boolean)] and that's all 
> fine... but is it "good style"? 
>
> [1] http://dev.clojure.org/display/community/Library+Coding+Standards 
> [2] https://github.com/bbatsov/clojure-style-guide#naming 
>
> Sean Corfield -- (904) 302-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: Style question (predicates)

2014-04-17 Thread Leif
My personal preference is that fns ending in ? return a strict boolean, to 
be consistent with clojure.core.  If I need the value I create another fn.  
So I would have nsf-code? *and* get-nsf-code.  Plus for more complicated 
values, if you change their representation you don't have to change the 
code calling the predicate, only the getter fn (if that),

--Leif

On Thursday, April 17, 2014 12:33:42 PM UTC-4, Sean Corfield wrote:
>
> The library coding standards[1] say: 
>
> * Use '?' suffix for predicates. 
>   - N.B. - predicates return booleans 
>
> and the community Clojure style guide[2] says: 
>
> * The names of predicate methods (methods that return a boolean value) 
> should end in a question mark. (i.e.even?). 
>
> Both of these imply that if you have a function that returns a boolean 
> (and that is intended for use as a predicate), it should be named to end in 
> '?'. Fair enough. 
>
> My question is about the reverse implication: 
>
> * Should a function whose name ends in '?' return a (strict) boolean 
> value? 
>
> Looking at the docstrings of a random selection of functions found by 
> (apropos "?"), they all seem to return specifically true or false. I did 
> not do an exhaustive check. 
>
> Is the intent that foo? implies a result of true or false - or could foo? 
> return any truthy / falsey value (and therefore any Clojure value). 
>
> Concrete example that spurred this discussion from some code at work: 
>
> (defn is-nsf-code? 
>   "Given an error code, return truthy if it is NSF." 
>   [code] 
>   (#{"BE1" "BE2"} code)) 
>
> Clearly the result here could be nil or a string but it's definitely meant 
> to be used as a predicate. Similarly: 
>
> (defn nsf? 
>   "Given the result of an SBW sale, return true if it failed with NSF." 
>   [result] 
>   (and (= "failure" (:result result)) 
>(some is-nsf-code? (:errors result 
>
> Again, the result could be false or nil or a string but is meant to be 
> used as a predicate. 
>
> As an aside, for core.typed, we annotate the first as [String -> Boolean] 
> with ^:no-check so it type checks as a true/false predicate and then we 
> annotate the second as [SBWResult -> (Nilable Boolean)] and that's all 
> fine... but is it "good style"? 
>
> [1] http://dev.clojure.org/display/community/Library+Coding+Standards 
> [2] https://github.com/bbatsov/clojure-style-guide#naming 
>
> Sean Corfield -- (904) 302-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.