Re: [ANN] immutable-int-map

2014-04-22 Thread tcrayford
Bonus: rename the library "immutable-long-map", then you can have a section in the readme titled "why the long map?" On Monday, 21 April 2014 13:12:05 UTC+1, Alex Miller wrote: > > This is great stuff. Why not longs? Are you going for space savings? -- You received this message because you are

Style - Keyword access or accessors?

2014-04-22 Thread Colin Yates
(This has been discussed before but as this is fairly subjective I am interested in whether people's opinion has changed) What are people's experiences around using keywords or defined accessors for navigating data structures in Clojure (assuming the use of maps)? Do people prefer using "raw"

Re: Style - Keyword access or accessors?

2014-04-22 Thread Daniel Kersten
I've personally always used keywords. I don't see any value in aliasing :foo to foo. For navigating nested maps, get-in, update-in and assoc-in with keywords seem natural and practical to me. On 22 April 2014 10:43, Colin Yates wrote: > (This has been discussed before but as this is fairly subj

Re: Style - Keyword access or accessors?

2014-04-22 Thread Colin Yates
Thanks Dan, One benefit is compile time safety and the refactoring I mentioned. But yes, I am coming around to the notion of just using raw keywords... On Tuesday, April 22, 2014 10:49:33 AM UTC+1, Dan Kersten wrote: > > I've personally always used keywords. I don't see any value in aliasing >

Re: Style - Keyword access or accessors?

2014-04-22 Thread Jim
there is really no reason to use `get-in` with keywords/symbols as they know how to look themselves up...in other words, you don't need to pay for any polymorphic calls : (get-in [:a :b :c :d] someMap) = (-> someMap :a :b :c :d) Jim On 22/04/14 10:49, Daniel Kersten wrote: For navigating nest

Re: Style - Keyword access or accessors?

2014-04-22 Thread Colin Yates
Nice. On Tuesday, April 22, 2014 11:36:06 AM UTC+1, Jim foo.bar wrote: > > there is really no reason to use `get-in` with keywords/symbols as they > know how to look themselves up...in other words, you don't need to pay > for any polymorphic calls : > > (get-in [:a :b :c :d] someMap) = (-> some

Re: clojurescript sandboxed code execution

2014-04-22 Thread Paul deGrandis
I would carefully question the desire for user stabilizability in this fashion, and then work through the quality attributes and design constraints for what you're trying to achieve. If what you end up needing is in fact an elisp-like system with closed/sandboxed functionality, one way to achie

lein uberjar much faster as lein run

2014-04-22 Thread Cecil Westerhof
When using lein run, I get the following measurements: 1 threads took 50292 milliseconds 2 threads took 28797 milliseconds 4 threads took 19531 milliseconds 6 threads took 16973 milliseconds 7 threads took 15761 milliseconds 8 threads took 15071 milliseconds While if I use lein u

Re: browser lisp editor

2014-04-22 Thread Jony Hudson
Codemirror is good too for this. http://codemirror.net Jony On Tuesday, 22 April 2014 05:30:23 UTC+1, Brian Craft wrote: > > Slightly off topic. > > Anyone know of a simple browser-based lisp editor that can be embedded in > a page? Indenting & matching parens would be sufficient. I don't nee

Re: lein uberjar much faster as lein run

2014-04-22 Thread Jony Hudson
I recall reading that `lein run` uses JVM options optimised for startup time, not performance - as it's intended for use in development, not production. I can't seem to find where I read that though ... Jony -- You received this message because you are subscribed to the Google Groups "Clojure

Re: where as clojure-fill-docstring gone?

2014-04-22 Thread Bastien
Hi Colin, Bastien writes: > That said, there are some quirks. I'm sick now and cannot > fix those problems, but please report them as github issues > if any. Bozhidar just merged a fix that I sent, you can check it here: https://github.com/clojure-emacs/clojure-mode/ Otherwise just wait till

Why can I not parse the command line arguments in this way

2014-04-22 Thread Cecil Westerhof
Obvious not very neat, but I tried as a first hack to do something with the command line parameters with: (doseq [type args] ​This does not work. Why not? ​ -- Cecil Westerhof -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this grou

Re: lein uberjar much faster as lein run

2014-04-22 Thread Lee Spector
On Apr 22, 2014, at 10:01 AM, Jony Hudson wrote: > I recall reading that `lein run` uses JVM options optimised for startup time, > not performance - as it's intended for use in development, not production. I > can't seem to find where I read that though ... Somebody with actual knowledge of w

Re: Why can I not parse the command line arguments in this way

2014-04-22 Thread Moritz Ulrich
This snippet is wholly incomplete. Can you please provide a more complete, testable example as well as a detailed description of the error you're seeing? On Tue, Apr 22, 2014 at 4:48 PM, Cecil Westerhof wrote: > Obvious not very neat, but I tried as a first hack to do something with the > command

Re: Why can I not parse the command line arguments in this way

2014-04-22 Thread Aaron France
One hates to be rude but: I've read all your questions over the past couple of weeks and it seems it would behoove you to pick up a book. There are plenty of recommendations on Google and archived threads. Good day. On 22 Apr 2014 16:48, "Cecil Westerhof" wrote: > Obvious not very neat, but I t

Re: where as clojure-fill-docstring gone?

2014-04-22 Thread Colin Yates
Thanks Bastien - I will wait until it lands in ELPA and try it then. On Tuesday, April 22, 2014 3:11:15 PM UTC+1, Bastien Guerry wrote: > > Hi Colin, > > Bastien > writes: > > > That said, there are some quirks. I'm sick now and cannot > > fix those problems, but please report them as github i

Re: [ANN] immutable-int-map

2014-04-22 Thread Alex Miller
On Tuesday, April 22, 2014 4:14:58 AM UTC-5, tcrayford wrote: > > Bonus: rename the library "immutable-long-map", then you can have a > section in the readme titled "why the long map?" > > On Monday, 21 April 2014 13:12:05 UTC+1, Alex Miller wrote: >> >> This is great stuff. Why not longs? Are y

Re: Style - Keyword access or accessors?

2014-04-22 Thread Alex Miller
Clojure is designed to make your data accessible generically without getters/setters or other custom APIs so I would encourage direct access via keywords over accessor fns. One consequence of this is that fns using a data structure have a direct coupling to the structure of the data. I prefer

Re: lein uberjar much faster as lein run

2014-04-22 Thread Cecil Westerhof
2014-04-22 16:50 GMT+02:00 Lee Spector : > > On Apr 22, 2014, at 10:01 AM, Jony Hudson wrote: > > > I recall reading that `lein run` uses JVM options optimised for startup > time, not performance - as it's intended for use in development, not > production. I can't seem to find where I read that t

Re: lein uberjar much faster as lein run

2014-04-22 Thread Gary Trakhman
https://github.com/technomancy/leiningen/blob/master/leiningen-core/src/leiningen/core/project.clj#L415 TieredCompilation is the relevant one. On Tue, Apr 22, 2014 at 10:01 AM, Jony Hudson wrote: > I recall reading that `lein run` uses JVM options optimised for startup > time, not performance

Re: lein uberjar much faster as lein run

2014-04-22 Thread Alex Miller
By default, lein run will use tiered compilation, which starts faster, but is not as fast. https://github.com/technomancy/leiningen/wiki/Faster On Tuesday, April 22, 2014 9:01:34 AM UTC-5, Jony Hudson wrote: > > I recall reading that `lein run` uses JVM options optimised for startup > time, no

Re: Style - Keyword access or accessors?

2014-04-22 Thread Colin Yates
Thanks Alex. Yep, I think Prismatic's schema is going to be invaluable for making the data structure less opaque and providing the comfort that I have lost from the lack of a rigorous and extensive strict type system (carefully avoiding the use of "strong", "lose", "static" and "dynamic" :)).

Re: Why can I not parse the command line arguments in this way

2014-04-22 Thread Cecil Westerhof
2014-04-22 16:55 GMT+02:00 Moritz Ulrich : > This snippet is wholly incomplete. Can you please provide a more > complete, testable example as well as a detailed description of the > error you're seeing? > ​It was a stupid mistake of me. When making the following example: (defn -main [& args]

determining repl environment vs. uberjar environment?

2014-04-22 Thread Dave Tenny
I have an app I'm building. It calls System/exit. That doesn't works so well if I'm debugging in the REPL however. What's the preferred method of determining whether I'm in REPL mode interaction vs running as a standalone app? Also, long as I'm asking and being lazy, does the -main function r

Which linux distro has intelij ?

2014-04-22 Thread Roelof Wobben
Hello, Does anyone know a Linux distro which I can use to learn clojure and which has inteljij aviable. I really like to test the cursive plugin Roelof -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@g

Re: browser lisp editor

2014-04-22 Thread Paul Bostrom
I wrote a thin Om wrapper around CodeMirror with Clojure syntax support and paren matching: https://github.com/pbostrom/om-codemirror It uses a slightly outdated version of CodeMirror from Nov 2013 but it should be good enough to get started if you want to go that route. It includes two hotkeys:

Books for learning Clojure

2014-04-22 Thread Cecil Westerhof
I have a ‘little’ to learn. ;-) I have worked with a lot of languages, including Lisp. I was thinking about the following books (in that order): - Practical Clojure - Clojure in Action - The Joy of Clojure - Clojure Programming - Programming Clojure Someone told me it was better to start with Prog

Re: Books for learning Clojure

2014-04-22 Thread Plínio Balduino
Some will say that Joy of Clojure is not the best choice for the newcomer. I read all the books more in your list more than once and had the better comprehension with JoC. The important thing is that I didn't get Clojure reading the first or second book. I just really understood after read the

Re: Books for learning Clojure

2014-04-22 Thread Cecil Westerhof
2014-04-22 20:32 GMT+02:00 Plínio Balduino : > Some will say that Joy of Clojure is not the best choice for the newcomer. > > I read all the books more in your list more than once and had the better > comprehension with JoC. > The important thing is that I didn't get Clojure reading the first or >

Re: Books for learning Clojure

2014-04-22 Thread Thiago Massa
I think you should care about learning the concepts involved in clojure and functional programming in general. "Getting" clojure after you have done some haskell, lisp or erlang is supposed to be a breeze, so you need to get to the basics! I bet that most of the books will teach you almost the sam

Re: Books for learning Clojure

2014-04-22 Thread Alex Ott
Hi I would recommend to take Programming Clojure or Clojure Programming first, and after that take the The Joy of Clojure (2ed)... On Tue, Apr 22, 2014 at 8:18 PM, Cecil Westerhof wrote: > I have a ‘little’ to learn. ;-) I have worked with a lot of languages, > including Lisp. I was thinking ab

Re: Books for learning Clojure

2014-04-22 Thread Alex Vzorov
I started with JoC and reading Programming Clojure now. Both give pretty good introduction to the language and its capabilities. JoC is full of not-so-simple examples, but they make one's brain work, show the clojure way, and are good for people how know they way around programming in general.

Re: Books for learning Clojure

2014-04-22 Thread Plínio Balduino
Exactly, Thiago. I just understood Clojure after dive into Clojure. The books helped a lot, but alone they are almost useless. Plínio On Tue, Apr 22, 2014 at 3:53 PM, Thiago Massa wrote: > I think you should care about learning the concepts involved in clojure > and functional programming in

Re: Books for learning Clojure

2014-04-22 Thread Gary Trakhman
JoC is like SICP, just really worth doing, not necessarily immediately practical. On Tue, Apr 22, 2014 at 3:16 PM, Plínio Balduino wrote: > Exactly, Thiago. > > I just understood Clojure after dive into Clojure. The books helped a lot, > but alone they are almost useless. > > Plínio > > > On Tue

Which linux distro has intelij ?

2014-04-22 Thread Mike Haney
I've used Intellij on Arch and Ubuntu, so I know it works on those (or at least it did - I switched to a Mac 18 months ago). Intellij runs on the JVM, so it should work on any distro in theory. JetBrains has a good knowledge base and forums on their site, so you can probably find details on co

Re: Which linux distro has intelij ?

2014-04-22 Thread Gary Trakhman
In general, there's always a mismatch between linux package managers and the realities of java stuff. So, I use apt-get (in ubuntu) to install java itself, and I throw everything else java-related (maven, ant, eclipse, whatever) in $HOME/opt, with symlinks to $HOME/bin (that's also where I put the

Re: Books for learning Clojure

2014-04-22 Thread Mike Haney
Yeah, JoC is my favorite clojure book, but I agree it's not the best to start with. Let me throw a couple others into the mix that haven't been mentioned yet. If you come from a solid OO background, I highly recommend Brian Marick's book "Functional Programming For the Object Oriented programm

core.async: closing a mix only when all inputs have emptied

2014-04-22 Thread Charles Duffy
Howdy -- Trying to use core.async's mix facility, one difficulty I've run into is the lack of a means to close the output channel only after al inputs have been exhausted. In the interim, I've ended up using the below instead -- which lacks some of the facilities provided by the mix interface (

Re: puzzled by RuntimeException

2014-04-22 Thread Greg D
I believe this is a problem in REPL-y, which is used when using 'lein repl'. I used Cider to start a nREPL server, then used 'leing repl :connect' to get the REPL-y interface. The problem was evident in the latter, but not the former. I opened an issue for REPL-y. Thanks again, Steve -- You

Re: Books for learning Clojure

2014-04-22 Thread Andrey Antukh
Hi Cecil I had read almost all books of you list and without a doubt clojure programming (o'reilly) is the best book for me ;) Andrey 2014-04-22 20:18 GMT+02:00 Cecil Westerhof : > I have a ‘little’ to learn. ;-) I have worked with a lot of languages, > including Lisp. I was thinking about the

Re: puzzled by RuntimeException

2014-04-22 Thread Stephen Gilardi
On Apr 22, 2014, at 5:37 PM, Greg D wrote: > I believe this is a problem in REPL-y, which is used when using 'lein repl'. > > I used Cider to start a nREPL server, then used 'leing repl :connect' to get > the REPL-y interface. > > The problem was evident in the latter, but not the former. I

Re: clojurescript sandboxed code execution

2014-04-22 Thread Paul deGrandis
I definitely mean "user customizibility" - sorry for the insane typo. -- 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

Re: Which linux distro has intelij ?

2014-04-22 Thread Andrew Chambers
Don't install intellij from and package manager (it will probably be out of date/not there), just install java then download it from the intellij/cursive website. Its self updating anyway and should work on any distro and on windows that way. On Wednesday, April 23, 2014 5:11:54 AM UTC+12, Roel

Re: browser lisp editor

2014-04-22 Thread Brian Craft
Thanks everyone, this is very helpful. On Tuesday, April 22, 2014 6:53:45 AM UTC-7, Jony Hudson wrote: > > Codemirror is good too for this. > > http://codemirror.net > > > Jony > > > On Tuesday, 22 April 2014 05:30:23 UTC+1, Brian Craft wrote: >> >> Slightly off topic. >> >> Anyone know of a simp

Re: Which linux distro has intelij ?

2014-04-22 Thread Colin Fleming
The comments here are basically spot on - I'm actually not sure what JetBrains' distro coverage is like, but as far as I know IntelliJ should work on most major distros. I've personally used it on Ubuntu and Suse. It's been a while since I used Java on a linux desktop (I'm on a Mac now too) but whe

Re: Clojure Office Hours

2014-04-22 Thread Bridget
Thanks, Leif, for offering these office hours. I just wrapped up my office hour with Leif. We chatted about Clojure community and open source project stuff, as that is what I needed help with, and he was very helpful in brainstorming ideas. If he offers office hours again, I'd recommend it high

Re: core.async: closing a mix only when all inputs have emptied

2014-04-22 Thread Ghadi Shayban
Howdy Charles, For a static mix of sources there's async/merge [1], and it behaves the almost exactly way you describe, impl here [2]. Stepping back, the source chan-of-chans being closed represents value production being fully in flight, while the merged channel being closed represents consump

citing Clojure and EDN?

2014-04-22 Thread vrakade
For the purposes of academic publications (in areas well outside of SIGPLAN and such), are there any preferred citations for Clojure and EDN? Or could a recommendation for a citation for both (especially EDN) be proposed if there isn't one currently? -- You received this message because you ar

Re: puzzled by RuntimeException

2014-04-22 Thread Alex Miller
Just FYI, some background on keywords that start with a number... The reader docs (http://clojure.org/reader) states that symbols (and keywords follow symbols in these rules) must "begin with a non-numeric character". The current Clojure reader accidentally accepts these due to a bug in the Lis

ring streaming efficiency

2014-04-22 Thread Andrew Chambers
When you set the body of a ring response to a java input stream and return it, is this still a thread per stream? or does it use some sort of java event loop for efficiency? I'm worried that a traffic download/upload server in ring wouldn't handle many concurrent large file uploads and downloads

Re: Which linux distro has intelij ?

2014-04-22 Thread Andrew Chambers
Just for reference, i use xubuntu (with the apt-get java jdk) and windows with cursive no problem. I love cursive compared to other clojure dev tools I've tried. On Wednesday, April 23, 2014 11:37:12 AM UTC+12, Andrew Chambers wrote: > > Don't install intellij from and package manager (it will p

Re: citing Clojure and EDN?

2014-04-22 Thread Alex Miller
I'm not sure exactly what you're looking for, but the EDN spec is https://github.com/edn-format/edn and was written by Rich Hickey. Seems like that is what you should cite. I don't know what it would mean to "cite" Clojure - it is software, written by many people over a period of years. Rich Hi

Re: ring streaming efficiency

2014-04-22 Thread James Reeves
Java input streams are blocking, rather than asynchronous, so yes it would use a thread per stream. In theory an asynchronous solution would be more efficient, and there are adapters, like http-kit, that support this optimisation. However, in practice, Java can handle many threads in a single pro

Re: ring streaming efficiency

2014-04-22 Thread Andrew Chambers
I need access control for the static files. The alternative is signed s3 urls which expire. Uploads still require streaming through ring however as i cant generate signed upload urls with the parameters that I need. On Wednesday, April 23, 2014 3:27:09 PM UTC+12, James Reeves wrote: > > Java inp

Re: Which linux distro has intelij ?

2014-04-22 Thread Ruslan Prokopchuk
Arch has one always up to date. вторник, 22 апреля 2014 г., 21:11:54 UTC+4 пользователь Roelof Wobben написал: > > Hello, > > Does anyone know a Linux distro which I can use to learn clojure and which > has inteljij aviable. > I really like to test the cursive plugin > > Roelof > > -- You re

Re: Clojure Office Hours

2014-04-22 Thread Cecil Westerhof
2014-04-18 11:35 GMT+02:00 Ulises : > Inspired by Leif's offer, I've decided to offer Clojure office hours as > well. > > I'm based in the UK so I reckon the times will be more amenable to those > in Europe (not sure the times will be good for those in Asia unfortunately.) > > Sadly the offer is l

Re: Books for learning Clojure

2014-04-22 Thread Cecil Westerhof
2014-04-22 20:18 GMT+02:00 Cecil Westerhof : > I have a ‘little’ to learn. ;-) I have worked with a lot of languages, > including Lisp. I was thinking about the following books (in that order): > - Practical Clojure > - Clojure in Action > - The Joy of Clojure > - Clojure Programming > - Programmi

Re: Books for learning Clojure

2014-04-22 Thread Marcus Blankenship
Let me also +10 for Eric Normand’s excellent Clojure videos, found at http://www.purelyfunctional.tv On Apr 22, 2014, at 10:13 PM, Cecil Westerhof wrote: > 2014-04-22 20:18 GMT+02:00 Cecil Westerhof : > I have a ‘little’ to learn. ;-) I have worked with a lot of languages, > including Lisp. I

Re: Which linux distro has intelij ?

2014-04-22 Thread Roelof Wobben
Thanks all for the remarks. Im now looking at codebox.io. The only thing I did not find so far is repl. The rest seems to be avaible. Roelof Op woensdag 23 april 2014 07:07:58 UTC+2 schreef Ruslan Prokopchuk: > Arch has one always up to date. > > вторник, 22 апреля 2014 г., 21:11:54 UTC+4 пол