Re: Migrate from IDEs to emacs or vim (already experienced with it) ?

2013-02-04 Thread Ersin Er
Thank you all for your valuable comments! For now I've decided to invest more in my *OS X Terminal*, *tmux* and *vim*setup. On Sun, Feb 3, 2013 at 2:13 AM, Gregory Graham wrote: > I first learned vi (the predecessor to vim) working on a senior project in > college in the early 1980s, and then

Re: ANN: http-kit 2.0.0.RC2, high performance HTTP Server & Client for Clojure

2013-02-04 Thread Feng Shen
Inspired by golang helloworld 45% slower than node.js , I did some test, get some numbers, for fun: CPU: Intel(R) Core(TM) i5-2500 CPU @ 3.30GHz RAM: 16G # redis, SET: 217391.30 requests per second# It's the upper lim

Re: Why is there not much conversation on Spreadsheet like APIs in this group?

2013-02-04 Thread john
>As a related point, if you are thinking of "spreadsheet" in the sense of a multi-dimensional grid, then you should definitely be looking at core.matrix anyway - it is shaping up to be the defacto standard for managing multi->dimensional array data structures in Clojure I meant "spreadsheet" in

dictionary sort in sortedmap

2013-02-04 Thread Amir Wasim
I want to sort a map by its keys according to dictionary when i do the following (into (sorted-map) {"1" "A" "2" "B" "11" "C" "3" "D"}) the result is {"1" "A", "11" "C", "2" "B", "3" "D"} which is expected result but what i expect is dictionary sort, {"1" "A", "2" "B", 3 "D", "11" "C"}. is

Re: Migrate from IDEs to emacs or vim (already experienced with it) ?

2013-02-04 Thread Wolodja Wentland
On Mon, Feb 04, 2013 at 10:56 +0200, Ersin Er wrote: > Thank you all for your valuable comments! > > For now I've decided to invest more in my OS X Terminal, tmux and vim setup. You might be interested in https://groups.google.com/forum/?fromgroups#!forum/vimclojure where everything vim + clojure

Re: Execute a subprocess that takes input e.g. emacs

2013-02-04 Thread Gabriel Horner
Thanks for the feedback Andy. I had a console-only emacs installed but I've reinstalled and confirmed one with X works. I was expecting a console editor to work as well as it does in ruby e.g. system("emacs -nw") but I'm guessing there's a limitation for java. Calling X emacs works for my use case

Re: dictionary sort in sortedmap

2013-02-04 Thread Dave Sann
http://clojuredocs.org/clojure_core/clojure.core/sorted-map-by On Monday, 4 February 2013 21:37:13 UTC+11, Amir Wasim wrote: > > I want to sort a map by its keys according to dictionary when i do the > following > > (into (sorted-map) {"1" "A" "2" "B" "11" "C" "3" "D"}) > > the result is > > {

Re: Performance issue with hashing records

2013-02-04 Thread Paul Stadig
On Sunday, February 3, 2013 9:56:49 PM UTC-5, puzzler wrote: > > In these examples, the map/record is freshly created each time through the > loop, so caching should not be a factor. > Good point. So maybe it's not the caching :). Another factor is that literal hashmaps are actually Persistent

ANN: lein-open and lein-grep 0.1.0

2013-02-04 Thread Gabriel Horner
Announcing two leiningen plugins: lein-open, http://github.com/cldwalker/lein-open, opens a local jar in an editor easily e.g. `lein open compojure`. By default it opens dependencies in your project.clj but if you specify a full name and version that works as well e.g. `lein open ring/ring-core

Re: Performance issue with hashing records

2013-02-04 Thread AtKaaZ
On Mon, Feb 4, 2013 at 12:13 PM, Paul Stadig wrote: > On Sunday, February 3, 2013 9:56:49 PM UTC-5, puzzler wrote: >> >> In these examples, the map/record is freshly created each time through >> the loop, so caching should not be a factor. >> > > Good point. So maybe it's not the caching :). > >

Re: dictionary sort in sortedmap

2013-02-04 Thread Feng Shen
Hi, "11" < "2" if string, 11 > 2 if integer. Your keys are string, convert to integer if need numeric order. On Monday, February 4, 2013 6:37:13 PM UTC+8, Amir Wasim wrote: > > I want to sort a map by its keys according to dictionary when i do the > following > > (into (sorted-map) {"1" "A"

is there a way to get the arguments to a function from outside the function?

2013-02-04 Thread larry google groups
I have an app. I would like to have debug mode and a production mode. In the debug mode, I would like it if the arguments to each function were pprint'ed to the terminal. Is there anyway to do this gracefully. I started adding pprint to all of my functions, and then I thought "There has got to

Re: is there a way to get the arguments to a function from outside the function?

2013-02-04 Thread Baishampayan Ghose
Checkout http://github.com/clojure/tools.trace ~BG Sent from phone. Please excuse brevity. On 4 Feb 2013 20:48, "larry google groups" wrote: > > I have an app. I would like to have debug mode and a production mode. In > the debug mode, I would like it if the arguments to each function were > ppr

Re: is there a way to get the arguments to a function from outside the function?

2013-02-04 Thread Softaddicts
With tools.trace you can turn tracing on or off on the fly using trace-vars or trace-ns. You will get the fn call and its result printed. Luc P. > Checkout http://github.com/clojure/tools.trace ~BG > > Sent from phone. Please excuse brevity. > On 4 Feb 2013 20:48, "larry google groups" > wr

atl-clj: Atlanta, GA, USA Clojure meetup

2013-02-04 Thread Marshall Bockrath-Vandegrift
Hi all: As I myself missed when this group got started, I’d like to delayed-announce the existence of atl-clj, a meetup group for Clojure users in the Atlanta, GA area: http://www.meetup.com/Atl-Clj/ Current plan is to meet ~monthly on second Tuesdays. The next scheduled meetup is for Febru

Re: dictionary sort in sortedmap

2013-02-04 Thread AtKaaZ
so, something like this? => (sorted-map-by (fn [key1 key2] (compare (Integer/parseInt key1) (Integer/parseInt key2))) "1" "A" "2" "B" "11" "C" "3" "D") {"1" "A", "2" "B", "3" "D", "11" "C"} On Mon, Feb 4, 2013 at 3:55 PM, Feng Shen wrote: > Hi, "11" < "2" if string, > 11 > 2 if intege

Re: Inflection on clojure.java.io/reader and writer

2013-02-04 Thread Kanwei Li
Hey Andy, Thanks for offering to help. Here's a gist: https://gist.github.com/4696105 As you can see at the bottom, I want the main method to read/write to STDIN/STDOUT, but for testing, I want to read from files instead. This is what I get in both CCW Eclipse and nrepl: Reflection warning, NO

Re: atl-clj: Atlanta, GA, USA Clojure meetup

2013-02-04 Thread Kanwei Li
Thanks for posting this. See you next week! On Monday, February 4, 2013 10:58:32 AM UTC-5, Marshall Bockrath-Vandegrift wrote: > > Hi all: > > As I myself missed when this group got started, I’d like to > delayed-announce the existence of atl-clj, a meetup group for Clojure > users in the Atla

Re: ANN: babbage 1.0.0, a library for easily gathering data and computing summary measures in a declarative way

2013-02-04 Thread Ben Wolfson
On Sat, Feb 2, 2013 at 11:29 AM, Jason Wolfe wrote: > > Surface differences aside, it would be really great if we could converge on > a common protocol and structure for graph/node input and output metadata, > since that could allow people to write code that worked with both libraries, > rather th

Re: Inflection on clojure.java.io/reader and writer

2013-02-04 Thread Andy Fingerhut
I don't have CCW Eclipse installed to test, but by saving that file on my Mac (should also work on Linux) in a subdirectory "obj", and editing it to add the ^java.io.BufferedReader in and ^java.io.BufferedWriter out type hints as suggested by Luc P. earlier in this thread, I was able to eliminat

Re: Inflection on clojure.java.io/reader and writer

2013-02-04 Thread AtKaaZ
in other words: this: (let [in (clojure.java.io/reader src) out (clojure.java.io/writer dest) becomes this: (let [^java.io.BufferedReader in (clojure.java.io/reader src) ^java.io.BufferedWriter out (clojure.java.io/writer dest) and it works for me too. (but I wasted some time

Clojure - Python Style suggestion

2013-02-04 Thread Sergey Didenko
Hi, For us as Clojure community it is easy to see how Clojure benefits from being a Lisp. Homoiconity, extreme conciseness, esoteric look and feel, etc. However it is hard to see from the inside how Clojure as ecosystem (probably) suffer from being a Lisp. Please don't throw rotten eggs at me, I

Re: Clojure - Python Style suggestion

2013-02-04 Thread Timothy Baldridge
Parens actually don't complect, they have a very very clear meaning. They organize functions and arguments. Let's take one line from your example: filter smaller xs Sois that the python equivalent to which of these? filter(smaller(xs)) filter(smaller, xs) filter(smaller(), xs()) filter(small

Re: Clojure - Python Style suggestion

2013-02-04 Thread Sergey Didenko
The main point is to reach new market by providing parentheses-lite Clojure syntax. Of course real serious Clojurians will be using the current syntax :) > Parens actually don't complect, they have a very very clear meaning. They > organize functions and arguments. Let's take one line from your e

Re: Clojure - Python Style suggestion

2013-02-04 Thread Sergey Didenko
Unfortunately I don't know Python good enough to answer this. The point though is just to mimic Python a very tiny bit. Basically to convert some of "(" and ")" to indentations. > Sois that the python equivalent to which of these? > filter(smaller(xs)) > filter(smaller, xs) > filter(smaller(),

Re: Clojure - Python Style suggestion

2013-02-04 Thread Tamreen Khan
Sergey's example code seems to have arguments to a function happen on the same line while new function calls appear on new lines. So: filter smaller xs ...would be the equivalent of filter(smaller(xs)). Anyway, I agree that parens don't add any more clutter. Having to *always* have all the arg

Re: Clojure - Python Style suggestion

2013-02-04 Thread Mimmo Cosenza
If someone is able to show me the homoiconity expressed in a better way than clojure I'll buy it. mimmo On Feb 4, 2013, at 9:15 PM, Sergey Didenko wrote: > Unfortunately I don't know Python good enough to answer this. The > point though is just to mimic Python a very tiny bit. Basically to > co

Re: Clojure - Python Style suggestion

2013-02-04 Thread Herwig Hochleitner
I can't see the community migrating to such a syntax, even if somebody bothered to implement a reader for it. For me, the parentheses are vital in editing my source code. With lisp, I'm editing faster than with any other language, thanks to paredit. Regarding people seeing parens as an obstacle: O

Re: Clojure - Python Style suggestion

2013-02-04 Thread Sergey Didenko
My point is to introduce a second-class syntax to attract orthodox users. Definitely not migrating. The rules of transformation can be so simple that any useful library written by Clojure Python style adopters could be translated to the canonical style automatically with a few line program. > I c

Re: Clojure - Python Style suggestion

2013-02-04 Thread Tamreen Khan
Again, I don't think it will help attract new users, at least not the way we want. Parentheses are an important part of the language and it's not something a beginner can just pick up later. If they're scared of parentheses now, they'll be scared when they try to jump from this paren-lite syntax to

Re: Clojure - Python Style suggestion

2013-02-04 Thread Gabriel Perdue
On Feb 4, 2013, at 2:01 PM, Sergey Didenko wrote: > For example the following quicksort implementation > > (defn qsort [[pivot & xs]] > (when pivot >(let [smaller #(< % pivot)] > (lazy-cat (qsort (filter smaller xs)) > [pivot] > (qsort (remove smaller xs

Re: Clojure - Python Style suggestion

2013-02-04 Thread Armando Blancas
> > What do you think? I think, go right ahead and give it to them. Worst that could happen is you gain insights into language design. I'd be interested in your users' comments; what worked, what didn't. If you really believe in that idea, don't give it up before you learn something from it

What compiles into a method body?

2013-02-04 Thread Brian Marick
An individual Midje "fact" (test case, roughly) macroexpands into a form like this: (record-fact-existence! (letfn [(fun1 [] ...test code is here...) (fun2 [] (with-meta fun1 {...metadata...}))] (fun2)) Tabular facts in Midje are done via unification. A table with

Re: Clojure - Python Style suggestion

2013-02-04 Thread Jason Lewis
Significant white space is the most horrifying development in programming languages in the last 20 years. Please kill this thread. On Feb 4, 2013 5:25 PM, "Armando Blancas" wrote: > What do you think? > > > I think, go right ahead and give it to them. Worst that could happen is > you gain insight

Re: Clojure - Python Style suggestion

2013-02-04 Thread Rich Morin
On Feb 4, 2013, at 15:15, Jason Lewis wrote: > Significant white space is the most horrifying development in programming > languages in the last 20 years. Oh, I think it has some competition there (but mostly agree). > Please kill this thread. There, I disagree. Clojurists should be open to th

Re: Clojure - Python Style suggestion

2013-02-04 Thread Gabriel Perdue
On Feb 4, 2013, at 5:33 PM, Rich Morin wrote: >> Significant white space is the most horrifying development in programming >> languages in the last 20 years. > > Oh, I think it has some competition there (but mostly agree). > > >> Please kill this thread. > > There, I disagree. Clojurists sh

Re: Clojure - Python Style suggestion

2013-02-04 Thread Mikhail Kryshen
The problem of readability of S-expressions has been discussed since the beginnings of Lisp. Some known alternative notations: http://en.wikipedia.org/wiki/M-expression http://readable.sourceforge.net/ On Mon, 4 Feb 2013 22:01:30 +0200 Sergey Didenko wrote: > Hi, > > For us as Clojure communi

Re: Clojure - Python Style suggestion

2013-02-04 Thread Leonardo Borges
Honestly I find myself missing S-Expressions in other languages now. The structure they provide is extremely useful in my opinion - especially when writing macros. Also, syntax is only one of the many facets of Clojure - if all the benefits and features Clojure provides doesn't cut it for newcomer

Re: Clojure - Python Style suggestion

2013-02-04 Thread Josh Kamau
I love the parenthesis please dont take them away ;) I dont want to learn a language syntax. I want a language "without a syntax" . And thats why i love clojure . Josh On Tue, Feb 5, 2013 at 2:57 AM, Leonardo Borges wrote: > Honestly I find myself missing S-Expressions in other languages

Re: What compiles into a method body?

2013-02-04 Thread Alan Malloy
Basically each lambda compiles into a method body, and the size of its lexical environment doesn't matter very much, only the amount of code inside the lambda's (fully macroexpanded) body. So in (fn a [x] (foo (letfn [(b [] (bar)) (c [] (baz))])), a only "pays for" foo, and b and c pay for bar

Re: ANN: lein-open and lein-grep 0.1.0

2013-02-04 Thread ronen
Nice plugins! Thanks for releasing On Monday, February 4, 2013 2:21:09 PM UTC+2, Gabriel Horner wrote: > > Announcing two leiningen plugins: > > lein-open, http://github.com/cldwalker/lein-open, opens a local jar in an > editor easily e.g. `lein open compojure`. By default it opens dependencies

Re: Clojure - Python Style suggestion

2013-02-04 Thread Dave Sann
The syntax does complect in one case. When you really do want a list as opposed to a function call. hence quote and (list ...) On Tuesday, 5 February 2013 07:06:37 UTC+11, tbc++ wrote: > > Parens actually don't complect, they have a very very clear meaning. They > organize functions and argumen

Re: What compiles into a method body?

2013-02-04 Thread Brian Marick
> I checked out midje and tried macroexpanding the test that's giving you > problems: it expands to 140KB of Clojure source! The culprit is indeed the > creation of your metadata maps: the :midje/body-source and :midje/source keys > are each around 40KB literals. You are my hero. Somehow the :

Re: Clojure - Python Style suggestion

2013-02-04 Thread Softaddicts
If you just think about the impacts of removing the top most parens and how you could hide this to tools like macros that may fiddle with your sexps you can only conclude that such a change is unlikely to happen. Plus changes to the compiler, IDEs, etc ... Phthon has the following delimiters: h

Re: Clojure - Python Style suggestion

2013-02-04 Thread Gregory Graham
I used to be a big Python user, and I liked the use of whitespace for structure back then. The only time it caused me a problem was when cutting and pasting code fragments, which didn't happen very often. Now that I've been using Racket (Scheme) and Clojure for a while, I like the parentheses b

Re: Clojure - Python Style suggestion

2013-02-04 Thread deliminator
I believe the parenthesis issue is best addressed in the editor. Emacs for example has paredit. Problem is, not all editors have an equivalent to paredit. A colleague uses sublime text, for which there is (or was) no paredit equivalent. It was painful watching him getting tripped up over unbala

Re: Clojure - Python Style suggestion

2013-02-04 Thread Rich Morin
On Feb 4, 2013, at 19:49, deliminator wrote: > Long story short: want more people to love lisp? > Implement paredit for more editors. +1! -r -- http://www.cfcl.com/rdmRich Morin http://www.cfcl.com/rdm/resume r...@cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Sof

Re: [ANN] oauth-clj

2013-02-04 Thread Leonardo Borges
Nobody ever replied to this and I'm now wondering the same. Any opinions one way or the other? On Tuesday, January 24, 2012 5:08:44 PM UTC+11, Dave Sann wrote: > > Hi r0man, > > I am curious as to similarities/differences of your library to: > https://github.com/mattrepl/clj-oauth > > Dave > --

techniques to work with Java mutable collections?

2013-02-04 Thread George Oliver
Hello, I'm writing a single-threaded TCP server for a bit of fun and learning, so I'm dealing with java.nio. I'm wondering how people here like to deal with mutable Java collections from Clojure. For example, I need to use java.nio.Selector and its Set of selected-keys (the channel sockets regi