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

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 bec

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 le

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': ,-

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 int

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

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 >

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

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 s

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

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 t

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 gr

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 wee

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 sing

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 (= "someStr

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 th

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 label

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

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

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, re

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 unorder

[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 ou

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, a

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 b

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

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 Goo

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

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 al

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

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

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+

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 i

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 "Cloj

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: L

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

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 fir

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"

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 ano

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

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 th

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

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 ch

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: x