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 learned Gosling emacs at my first job
> in the late 1980s. Since then, I have gone back and forth between the two
> for various reasons, and I'm about equally comfortable in each of them. For
> a while, I preferred vim since it had better GUI font rendering than emacs,
> but since I started playing with Clojure, I got back into emacs, using
> nrepl, and I must say it's a pretty nice setup. The font rendering is no
> longer an issue, and emacs now has a cool package install feature that
> makes adding advanced features a breeze.
>>
>>
> My perception is that emacs has an edge in the Lisp/Clojure world, but I
> see plenty of people using vim. I have not tried a vim clojure setup
> because once I got emacs setup, I was happy. If you are used to vim, and
> you find it works well for Clojure, then there's nothing wrong with going
> with that. After all, its about finding a tool that works for you, whether
> or not it's the most popular or the coolest.
>
> --
> --
> 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/groups/opt_out.
>
>
>



-- 
Ersin Er

-- 
-- 
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/groups/opt_out.




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 limit, probably  
redis-benchmark -q 
# nginx, response a file of 1K# Requests per second:148442.25 [#/sec] 
(mean), 
ab -n 30 -c 100 -k http://127.0.0.1/  
# http-kit (http://http-kit.org)  respond hello world# code: 
https://gist.github.com/4704565# Requests per second:79.02 [#/sec] 
(mean)
ab -n 40 -c 100 -k http://127.0.0.1:8080/
# The hello world go version, with modification of "http" => "net/http" # 
Requests per second:17465.92 [#/sec] (mean)
ab -n 10 -c 100 -k http://127.0.0.1:8080/
# node v0.6.19 # Requests per second:12964.05 [#/sec] (mean)
ab -n 10 -c 100 -k http://127.0.0.1:8080



On Sunday, February 3, 2013 11:20:27 AM UTC+8, Feng Shen wrote:
>
> Hi, 
>
> After extensive test,  known bugs  fixed, documentation ready,  http-kit 
> reaches 2.0.0.RC2
>
> [http-kit "2.0.0-RC2"] ; Add to your project.clj
>
> Documentation: http://http-kit.org
> Github: https://github.com/http-kit/http-kit
>
> The goal of http-kit is to provide a clean, robust HTTP server/client, 
> with Nginx alike performance and concurrency, for Clojure.
> The server is ring compliant adapter with async and websocket support. 
>  I expect it to be faster than node.
> The client has a clj-http alike API,  asynchronous in nature, synchronous 
> with @promise.
>
> I invite everybody who interested to have a look, 
> questions/comments/suggestions/whatever are welcome! 
>
> Thanks @ptaoussanis and others for their contribution. 
>
> Feng
>

-- 
-- 
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/groups/opt_out.




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 the excel sense where your cells are dependant on 
each other. So operations are specific to individual cells and are not 
applied to a whole matrix. 

Stephan and especially Don (dcj)  describe exactly what I'm trying to 
achive.
 And I would be happy to colaberate with others to find a good solution.  I 
think I will start with Stephan's best practice (Jeff Straszheim's graph 
contrib library) and 
try  to post here some example code...


-- 
-- 
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/groups/opt_out.




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 there something in clojure or i just go with 
java Collator 

thanks


-- 
-- 
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/groups/opt_out.




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

Enjoy!
-- 
Wolodja 

4096R/CAF14EFC
081C B7CD FF04 2BA9 94EA  36B2 8B7F 7D30 CAF1 4EFC


signature.asc
Description: Digital signature


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 but I'd be interested to hear if anyone solves opening a console
editor.

On Sun, Feb 3, 2013 at 6:50 PM, Andy Fingerhut wrote:

> I was able to open an X windows emacs session using:
>
> (require '[clojure.java.shell :as sh])
> (sh/sh "emacs")
>
> on my system.  The REPL did not give another prompt until I quit that
> emacs invocation.  I was able to get another REPL prompt immediately using
> this:
>
> (future (sh/sh "emacs"))
>
> When I tried running the terminal version of emacs without using the X
> window system, it gave a valid complaint like this:
>
> user=> (sh/sh "emacs" "-nw")
> {:exit 1, :out "", :err "emacs: standard input is not a tty\n"}
>
> You can also specify the file name and line number where the cursor should
> initially be placed like so:
>
> (sh/sh "emacs" "+57" "foo.txt")
>
> In case it matters what versions of things I am using, I was able to get
> similar results above on both of the following systems:
>
> Mac OS X 10.6.8 + Oracle/Apple JDK 1.6.0_37 + Leiningen 2.0.0 + Clojure
> 1.5.0-RC2
> Ubuntu 11.10 32-bit desktop + Oracle JDK 1.6.0_38 + Leiningen 2.0.0 +
> Clojure 1.5.0-RC4
>
> I also tried it with Clojure 1.4.0 with the same good results.
>
> Andy
>
>
> On Feb 3, 2013, at 2:30 PM, Gabriel Horner wrote:
>
> > Hi,
> >
> > Is there a straightforward way to invoke an editor within clojure e.g.
> (clojure.java.shell/sh "emacs" some-file)?
> > I've taken a look at popular shell libraries like conch and stevedore
> but found nothing helpful.
> > If you're curious why I want to do it, it's to open a lein dependency in
> emacs from the commandline, https://github.com/cldwalker/lein-open .
> >
> > Thanks,
> > Gabriel
>
> --
> --
> 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/groups/opt_out.
>
>
>

-- 
-- 
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/groups/opt_out.




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
>
> {"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 there something in clojure or i just go with 
> java Collator 
>
> thanks
>
>
>

-- 
-- 
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/groups/opt_out.




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 PersistentArrayMaps. 
If you use PersistentHashMaps instead of PersistentArrayMaps you get 
similar performance:

Clojure 1.5.0-RC4
user=> (class {:x "a" :y 3})
clojure.lang.PersistentArrayMap
user=> (time (dotimes [n 1000] (hash (hash-map :x "a" :y 3
"Elapsed time: 3315.031872 msecs"
nil


Paul

-- 
-- 
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/groups/opt_out.




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

lein-grep,  http://github.com/cldwalker/lein-grep, improves on the default 
search by displaying one result per line in a well formatted table. I 
recommend the readme to compare its output to `lein search`.

Feedback welcome.
Thanks,
Gabriel

-- 
-- 
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/groups/opt_out.




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 :).
>
> Another factor is that literal hashmaps are actually PersistentArrayMaps.
> If you use PersistentHashMaps instead of PersistentArrayMaps you get
> similar performance:
>
> Clojure 1.5.0-RC4
> user=> (class {:x "a" :y 3})
> clojure.lang.PersistentArrayMap
>
well that explains why there's more time in this sample:
=> (class {:x "a" :y 3})
clojure.lang.Persistent*Array*Map
=> (def m {:x "a" :y 3})
#'runtime.q/m
=> (class m)
clojure.lang.Persistent*Hash*Map
=> (time (dotimes [n 1000] (hash m)))
"Elapsed time: 168.162927 msecs"
nil
=> (time (dotimes [n 1000] (hash m)))
"Elapsed time: 161.341094 msecs"
nil
=> (time (dotimes [n 1000] (hash m)))
"Elapsed time: 159.444025 msecs"
nil
=> (time (dotimes [n 1000] (hash {:x "a" :y 3})))
"Elapsed time: 54.29475 msecs"
nil
=> (time (dotimes [n 1000] (hash {:x "a" :y 3})))
"Elapsed time: 68.322372 msecs"
nil
=> (time (dotimes [n 1000] (hash {:x "a" :y 3})))
"Elapsed time: 57.707132 msecs"
nil


> user=> (time (dotimes [n 1000] (hash (hash-map :x "a" :y 3
> "Elapsed time: 3315.031872 msecs"
> nil
>
> => (time (dotimes [n 1000] (hash (hash-map :x "a" :y 3
"Elapsed time: 8495.188813 msecs"
=> (def hm (hash-map :x "a" :y 3))
#'runtime.q/hm
=> (time (dotimes [n 1000] (hash hm)))
"Elapsed time: 155.623505 msecs"
nil
=> (time (dotimes [n 1000] (hash hm)))
"Elapsed time: 160.494044 msecs"
nil


>
> Paul
>
> --
> --
> 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/groups/opt_out.
>
>
>



-- 
Please correct me if I'm wrong or incomplete,
even if you think I'll subconsciously hate it.

-- 
-- 
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/groups/opt_out.




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" "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 there something in clojure or i just go with 
> java Collator 
>
> thanks
>
>
>

-- 
-- 
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/groups/opt_out.




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 
be a way that is more elegant than this."



-- 
-- 
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/groups/opt_out.




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
> 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
> be a way that is more elegant than this."
>
>
>
>  --
> --
> 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/groups/opt_out.
>
>
>

-- 
-- 
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/groups/opt_out.




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" 
> 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
> > 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
> > be a way that is more elegant than this."
> >
> >
> >
> >  --
> > --
> > 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/groups/opt_out.
> >
> >
> >
> 
> -- 
> -- 
> 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/groups/opt_out.
> 
> 
> 
--
Softaddicts sent by ibisMail from my ipad!

-- 
-- 
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/groups/opt_out.




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 February 12th, where I’ll be giving a talk + live-coding
demo on Cascalog.

If you’re in the Atlanta area, I hope you can make it!

-Marshall

-- 
-- 
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/groups/opt_out.




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 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" "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 there something in clojure or i just go with
>> java Collator 
>>
>> thanks
>>
>>
>>  --
> --
> 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/groups/opt_out.
>
>
>



-- 
Please correct me if I'm wrong or incomplete,
even if you think I'll subconsciously hate it.

-- 
-- 
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/groups/opt_out.




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_SOURCE_PATH:4 - reference to field readLine can't be 
resolved.

Reflection warning, NO_SOURCE_PATH:11 - reference to field readLine can't 
be resolved.

Reflection warning, NO_SOURCE_PATH:29 - reference to field newLine can't be 
resolved.

Reflection warning, NO_SOURCE_PATH:20 - reference to field newLine can't be 
resolved.
Thanks!

On Sunday, February 3, 2013 4:38:38 PM UTC-5, Andy Fingerhut wrote:
>
> Can you post a larger chunk of code for us to examine, perhaps on github 
> or as a gist if it is over 30 lines of code or so?  Many of us have had 
> good success with eliminating reflection using type hints, so it should be 
> possible to make it work.
>
> Andy
>
> On Feb 3, 2013, at 12:50 PM, Kanwei Li wrote:
>
> Unfortunately it doesn't work.
>
> Reflection warning, NO_SOURCE_PATH:20 - call to write can't be resolved.
>
> Reflection warning, NO_SOURCE_PATH:21 - reference to field newLine can't 
> be resolved.
>
> On Sunday, February 3, 2013 2:35:23 PM UTC-5, Luc wrote:
>>
>> Why not add type hints like this ? 
>>
>> (let [^java.io.BufferedReader in  
>>^java.io.BufferedWriter out ...] 
>> .. 
>>
>> Luc P. 
>>
>> > Hey guys, 
>> > 
>> > I'm trying to read a lot of data, sometimes from *in* and sometimes 
>> from a 
>> > file. I extensively use the native .write and .read java methods. 
>> > 
>> > According to the clojure doc for reader, it says that "Default 
>> > implementations always return a BufferedReader". However, when I write, 
>> > 
>> > (*defn* solve [src dest] 
>> > 
>> >   (*let* [in (clojure.java.io/reader src) 
>> > 
>> > out (clojure.java.io/writer dest) 
>> > 
>> > I get a bunch of reflection warnings on .read and .write, and most of 
>> the 
>> > running time is spent on reflection. AFAIK you can't type hint a (let) 
>> > construct, so what should I do here? 
>> > 
>> > Thanks! 
>
>

-- 
-- 
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/groups/opt_out.




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 Atlanta, GA area: 
>
> http://www.meetup.com/Atl-Clj/ 
>
> Current plan is to meet ~monthly on second Tuesdays.  The next scheduled 
> meetup is for February 12th, where I’ll be giving a talk + live-coding 
> demo on Cascalog. 
>
> If you’re in the Atlanta area, I hope you can make it! 
>
> -Marshall 
>
>

-- 
-- 
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/groups/opt_out.




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 than forcing people to choose and end up with separate silos.  I'd
> love to discuss this (and hear your comments on our implementation) here or
> off-list.

Agreed that this would be nice! I'll look through how you're doing it;
hopefully convergence will be easy.

-- 
Ben Wolfson
"Human kind has used its intelligence to vary the flavour of drinks,
which may be sweet, aromatic, fermented or spirit-based. ... Family
and social life also offer numerous other occasions to consume drinks
for pleasure." [Larousse, "Drink" entry]

-- 
-- 
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/groups/opt_out.




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 eliminate the 
reflection warnings:

% mkdir obj
% cp  obj/solutions.clj

# Original file without the type hints gives reflection warnings as expected

% java -Dclojure.compile.path=./obj -cp clojure-1.4.0.jar:./obj 
clojure.lang.Compile solution
Compiling solution to ./obj
Reflection warning, solution.clj:38 - reference to field readLine can't be 
resolved.
Reflection warning, solution.clj:45 - reference to field readLine can't be 
resolved.
Reflection warning, solution.clj:63 - reference to field newLine can't be 
resolved.
Reflection warning, solution.clj:54 - reference to field newLine can't be 
resolved.

# Now I hand-edit obj/solutions.clj to add the type hints, and recompile.  No 
reflection warnings.
% java -Dclojure.compile.path=./obj -cp clojure-1.4.0.jar:./obj 
clojure.lang.Compile solution
Compiling solution to ./obj
% 

Perhaps you should try verifying that you added the type hints correctly, saved 
the source file, recompiled the one you wanted to in CCW Eclipse, etc.

Andy


On Feb 4, 2013, at 9:10 AM, Kanwei Li wrote:

> 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_SOURCE_PATH:4 - reference to field readLine can't be 
> resolved.
> 
> Reflection warning, NO_SOURCE_PATH:11 - reference to field readLine can't be 
> resolved.
> 
> Reflection warning, NO_SOURCE_PATH:29 - reference to field newLine can't be 
> resolved.
> 
> Reflection warning, NO_SOURCE_PATH:20 - reference to field newLine can't be 
> resolved.
> 
> Thanks!
> 
> On Sunday, February 3, 2013 4:38:38 PM UTC-5, Andy Fingerhut wrote:
> Can you post a larger chunk of code for us to examine, perhaps on github or 
> as a gist if it is over 30 lines of code or so?  Many of us have had good 
> success with eliminating reflection using type hints, so it should be 
> possible to make it work.
> 
> Andy
> 
> On Feb 3, 2013, at 12:50 PM, Kanwei Li wrote:
> 
>> Unfortunately it doesn't work.
>> 
>> Reflection warning, NO_SOURCE_PATH:20 - call to write can't be resolved.
>> 
>> Reflection warning, NO_SOURCE_PATH:21 - reference to field newLine can't be 
>> resolved.
>> 
>> 
>> On Sunday, February 3, 2013 2:35:23 PM UTC-5, Luc wrote:
>> Why not add type hints like this ? 
>> 
>> (let [^java.io.BufferedReader in  
>>^java.io.BufferedWriter out ...] 
>> .. 
>> 
>> Luc P. 
>> 
>> > Hey guys, 
>> > 
>> > I'm trying to read a lot of data, sometimes from *in* and sometimes from a 
>> > file. I extensively use the native .write and .read java methods. 
>> > 
>> > According to the clojure doc for reader, it says that "Default 
>> > implementations always return a BufferedReader". However, when I write, 
>> > 
>> > (*defn* solve [src dest] 
>> > 
>> >   (*let* [in (clojure.java.io/reader src) 
>> > 
>> > out (clojure.java.io/writer dest) 
>> > 
>> > I get a bunch of reflection warnings on .read and .write, and most of the 
>> > running time is spent on reflection. AFAIK you can't type hint a (let) 
>> > construct, so what should I do here? 
>> > 
>> > Thanks! 
> 
> 
> -- 
> -- 
> 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/groups/opt_out.
>  
>  

-- 
-- 
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/groups/opt_

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 by having BufferedReader
in both places)


On Mon, Feb 4, 2013 at 6:26 PM, Andy Fingerhut wrote:

> 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
> eliminate the reflection warnings:
>
> % mkdir obj
> % cp  obj/solutions.clj
>
> # Original file without the type hints gives reflection warnings as
> expected
>
> % java -Dclojure.compile.path=./obj -cp clojure-1.4.0.jar:./obj
> clojure.lang.Compile solution
> Compiling solution to ./obj
> Reflection warning, solution.clj:38 - reference to field readLine can't be
> resolved.
> Reflection warning, solution.clj:45 - reference to field readLine can't be
> resolved.
> Reflection warning, solution.clj:63 - reference to field newLine can't be
> resolved.
> Reflection warning, solution.clj:54 - reference to field newLine can't be
> resolved.
>
> # Now I hand-edit obj/solutions.clj to add the type hints, and recompile.
>  No reflection warnings.
> % java -Dclojure.compile.path=./obj -cp clojure-1.4.0.jar:./obj
> clojure.lang.Compile solution
> Compiling solution to ./obj
> %
>
> Perhaps you should try verifying that you added the type hints correctly,
> saved the source file, recompiled the one you wanted to in CCW Eclipse, etc.
>
> Andy
>
>
> On Feb 4, 2013, at 9:10 AM, Kanwei Li wrote:
>
> 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_SOURCE_PATH:4 - reference to field readLine can't
> be resolved.
>
> Reflection warning, NO_SOURCE_PATH:11 - reference to field readLine can't
> be resolved.
>
> Reflection warning, NO_SOURCE_PATH:29 - reference to field newLine can't
> be resolved.
>
> Reflection warning, NO_SOURCE_PATH:20 - reference to field newLine can't
> be resolved.
> Thanks!
>
> On Sunday, February 3, 2013 4:38:38 PM UTC-5, Andy Fingerhut wrote:
>>
>> Can you post a larger chunk of code for us to examine, perhaps on github
>> or as a gist if it is over 30 lines of code or so?  Many of us have had
>> good success with eliminating reflection using type hints, so it should be
>> possible to make it work.
>>
>> Andy
>>
>> On Feb 3, 2013, at 12:50 PM, Kanwei Li wrote:
>>
>> Unfortunately it doesn't work.
>>
>> Reflection warning, NO_SOURCE_PATH:20 - call to write can't be resolved.
>>
>> Reflection warning, NO_SOURCE_PATH:21 - reference to field newLine can't
>> be resolved.
>>
>> On Sunday, February 3, 2013 2:35:23 PM UTC-5, Luc wrote:
>>>
>>> Why not add type hints like this ?
>>>
>>> (let [^java.io.BufferedReader in 
>>>^java.io.BufferedWriter out ...]
>>> ..
>>>
>>> Luc P.
>>>
>>> > Hey guys,
>>> >
>>> > I'm trying to read a lot of data, sometimes from *in* and sometimes
>>> from a
>>> > file. I extensively use the native .write and .read java methods.
>>> >
>>> > According to the clojure doc for reader, it says that "Default
>>> > implementations always return a BufferedReader". However, when I
>>> write,
>>> >
>>> > (*defn* solve [src dest]
>>> >
>>> >   (*let* [in (clojure.java.io/reader src)
>>> >
>>> > out (clojure.java.io/writer dest)
>>> >
>>> > I get a bunch of reflection warnings on .read and .write, and most of
>>> the
>>> > running time is spent on reflection. AFAIK you can't type hint a (let)
>>> > construct, so what should I do here?
>>> >
>>> > Thanks!
>>
>>
> --
> --
> 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/groups/opt_out.
>
>
>
>
>  --
> --
> 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 

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 mean only the part of Lisp that is ... parentheses.

I remember a number of people that mention parentheses as obstacles to
the wider Clojure adoption, in the Clojure space - in the Clojure
related discussions, even on this mailing list IIRC.

But the number of people thinking this way outside the Clojure groups
is even bigger! We probably don't notice it because got immune to this
famous argument "it has too many parentheses" early when diving into
Clojure.

I suggest there are a big number of people that could gain interest in
clojure if we provide them with parentheses-lite Clojure syntax. For
example we can steal Python way of intending blocks.

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

could be written as

(set! python-style-op-op true)

defn qsort [[pivot & xs]]
  when pivot
let [smaller #(< % pivot)]
  lazy-cat
qsort
  filter smaller xs
[pivot]
qsort
  remove smaller xs

What do you think?

Isn't is less complex?


P.S. Ok, I must confess, the mention of the C-Word in the last
sentence was just a desperate way to get Rich's attention.

P.P.S. Actually I would also love to see Clojure community making
video clip "Clojure - Python Style" as a remix for "G... Style", but
this idea is probably way ahead of its time.


Regards, Sergey.

-- 
-- 
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/groups/opt_out.




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(smaller(xs()))

I would also assert that Python complects formatting and semantic meaning
of the code. I'm quite proficient at Python and even I hate that fact.

Timothy



On Mon, Feb 4, 2013 at 1:01 PM, Sergey Didenko wrote:

> 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 mean only the part of Lisp that is ... parentheses.
>
> I remember a number of people that mention parentheses as obstacles to
> the wider Clojure adoption, in the Clojure space - in the Clojure
> related discussions, even on this mailing list IIRC.
>
> But the number of people thinking this way outside the Clojure groups
> is even bigger! We probably don't notice it because got immune to this
> famous argument "it has too many parentheses" early when diving into
> Clojure.
>
> I suggest there are a big number of people that could gain interest in
> clojure if we provide them with parentheses-lite Clojure syntax. For
> example we can steal Python way of intending blocks.
>
> 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))
>
> could be written as
>
> (set! python-style-op-op true)
>
> defn qsort [[pivot & xs]]
>   when pivot
> let [smaller #(< % pivot)]
>   lazy-cat
> qsort
>   filter smaller xs
> [pivot]
> qsort
>   remove smaller xs
>
> What do you think?
>
> Isn't is less complex?
>
>
> P.S. Ok, I must confess, the mention of the C-Word in the last
> sentence was just a desperate way to get Rich's attention.
>
> P.P.S. Actually I would also love to see Clojure community making
> video clip "Clojure - Python Style" as a remix for "G... Style", but
> this idea is probably way ahead of its time.
>
>
> Regards, Sergey.
>
> --
> --
> 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/groups/opt_out.
>
>
>


-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)

-- 
-- 
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/groups/opt_out.




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

-- 
-- 
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/groups/opt_out.




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(), xs())
> filter(smaller(xs()))

-- 
-- 
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/groups/opt_out.




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 arguments on the same line could lead to needlessly long
lines. I also don't see how syntax like this would make the transition to
full Clojure with all the parentheses any easier. Beginners would still shy
away from all the parens and never go beyond playing around with the
language.

Would Python ever have a "indent-lite" version that allowed beginners to
use braces instead of indentation? Of course not, because learning to read
and write code with significant whitespace is an important part of python.
If a beginner doesn't learn those things from the start they'll only
handicap themselves more later on. And the same goes with Clojure, it's
important to learn those parentheses from the beginning so you can lose
your fear of them earlier on.

Tamreen


On Mon, Feb 4, 2013 at 3:06 PM, Timothy Baldridge wrote:

> 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(smaller(xs()))
>
> I would also assert that Python complects formatting and semantic meaning
> of the code. I'm quite proficient at Python and even I hate that fact.
>
> Timothy
>
>
>
> On Mon, Feb 4, 2013 at 1:01 PM, Sergey Didenko 
> wrote:
>
>> 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 mean only the part of Lisp that is ... parentheses.
>>
>> I remember a number of people that mention parentheses as obstacles to
>> the wider Clojure adoption, in the Clojure space - in the Clojure
>> related discussions, even on this mailing list IIRC.
>>
>> But the number of people thinking this way outside the Clojure groups
>> is even bigger! We probably don't notice it because got immune to this
>> famous argument "it has too many parentheses" early when diving into
>> Clojure.
>>
>> I suggest there are a big number of people that could gain interest in
>> clojure if we provide them with parentheses-lite Clojure syntax. For
>> example we can steal Python way of intending blocks.
>>
>> 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))
>>
>> could be written as
>>
>> (set! python-style-op-op true)
>>
>> defn qsort [[pivot & xs]]
>>   when pivot
>> let [smaller #(< % pivot)]
>>   lazy-cat
>> qsort
>>   filter smaller xs
>> [pivot]
>> qsort
>>   remove smaller xs
>>
>> What do you think?
>>
>> Isn't is less complex?
>>
>>
>> P.S. Ok, I must confess, the mention of the C-Word in the last
>> sentence was just a desperate way to get Rich's attention.
>>
>> P.P.S. Actually I would also love to see Clojure community making
>> video clip "Clojure - Python Style" as a remix for "G... Style", but
>> this idea is probably way ahead of its time.
>>
>>
>> Regards, Sergey.
>>
>> --
>> --
>> 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/groups/opt_out.
>>
>>
>>
>
>
> --
> “One of the main causes of the fall of the Roman Empire was that–lacking
> zero–they had no way to indicate successful termination of their C
> programs.”
> (Robert Firth)
>
> --
> --
> 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

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
> convert some of "(" and ")" to indentations.
> 
>> Sois that the python equivalent to which of these?
>> filter(smaller(xs))
>> filter(smaller, xs)
>> filter(smaller(), xs())
>> filter(smaller(xs()))
> 
> -- 
> -- 
> 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/groups/opt_out.
> 
> 

-- 
-- 
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/groups/opt_out.




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: Of all the arguments one
could make against Clojure as a strict, dynamically typed, lexically
scoped, JVM hosted lisp; when I hear someone complaining about the parens I
conclude that this person didn't look at the real merits and trade-offs of
clojure and/or didn't understand them.

While I still think, we should cater to them as users, introducing a new
surface syntax doesn't strike me as a net win.
I'm happy to gain them as users, as soon as their company switches to
clojure ;-)

If you still want to go down that route, have a look at dylan:
http://en.wikipedia.org/wiki/Dylan_(programming_language)

-- 
-- 
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/groups/opt_out.




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 can't see the community migrating to such a syntax, even if somebody

-- 
-- 
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/groups/opt_out.




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 full Clojure. And it's for the same reasons that
Python doesn't have a 'simpler' version without significant whitespace.


On Mon, Feb 4, 2013 at 3:30 PM, Sergey Didenko wrote:

> 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 can't see the community migrating to such a syntax, even if somebody
>
> --
> --
> 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/groups/opt_out.
>
>
>

-- 
-- 
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/groups/opt_out.




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))
> 
> could be written as
> 
> (set! python-style-op-op true)
> 
> defn qsort [[pivot & xs]]
>  when pivot
>let [smaller #(< % pivot)]
>  lazy-cat
>qsort
>  filter smaller xs
>   [pivot]
>   qsort
>  remove smaller xs
> 
> What do you think?

I think that looks a bit like Haskell.  :)

pax
Gabe

-- 
-- 
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/groups/opt_out.




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.

-- 
-- 
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/groups/opt_out.




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 8 rows turns into 
8 individual facts (each of that structure), surrounded by an outer level fact 
that runs each of them. This is wasteful of space but allows unusually 
expressive tests.

Something I've done recently seems to have pushed some tabular facts over the 
Java method-length limit:

> Caused by: java.lang.ClassFormatError: Invalid method Code length 81209 in 
> class file midje/t_checkers$eval24254$this_function_here_24253__24497

(This is actually surprising, since I don't see what I've done today that could 
push the size so *much* over 64K.)

I hope my two breaking tabular facts are atypically large, but I fear not. So, 
some questions / thoughts:

1. Do mutually recursive `letfn` functions get compiled into a single method? 
More generally, I hope that any nested function definitions turn into separate 
methods. Do they?

2. The metadata is rather large - can it somehow end up increasing the method 
bytecodes? What if it's constructed via merging literals, like this:

  (clojure.core/merge
   '{:midje/body-source ((+ 1 1) => 2), ...}
   {:midje/top-level-fact? true})))]

The guts of assertion checking also involves merging maps:

(check-one (clojure.core/merge
{:position
 :expected-result-form '2,
 :expected-result 2,
 :function-under-test (clojure.core/fn [] (+ 1 1))}
{:arrow '=>, :call-form '1}
(hash-map-duplicates-ok :position (line-number-known 2

3. Midje goes to a lot of trouble to obey lexical scoping, so that you can 
write, for example:

(let [a 2]
  (fact
(let [b 2]
  (+ a b) => (* a b)))

Do closed-over lexical environments contribute unduly to method size? 

4. How can I get a look at what a big fact compiles into? (I suppose I need to 
AOT-compile a test namespace, but I've never had much luck with that.)


Looking for 1/2-time employment as a Clojure programmer
Latest book: /Functional Programming for the Object-Oriented Programmer/
https://leanpub.com/fp-oo

-- 
-- 
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/groups/opt_out.




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 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.
>
> --
> --
> 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/groups/opt_out.
>
>
>

-- 
-- 
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/groups/opt_out.




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 the idea of syntactic
experimentation, even if they don't personally like the direction.

-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

Software system design, development, and documentation


-- 
-- 
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/groups/opt_out.




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 should be open to the idea of syntactic
> experimentation, even if they don't personally like the direction.

Are you suggesting people not be so cloje-minded? :)

pax
Gabe

-- 
-- 
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/groups/opt_out.




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 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 mean only the part of Lisp that is ... parentheses.
> 
> I remember a number of people that mention parentheses as obstacles to
> the wider Clojure adoption, in the Clojure space - in the Clojure
> related discussions, even on this mailing list IIRC.
> 
> But the number of people thinking this way outside the Clojure groups
> is even bigger! We probably don't notice it because got immune to this
> famous argument "it has too many parentheses" early when diving into
> Clojure.
> 
> I suggest there are a big number of people that could gain interest in
> clojure if we provide them with parentheses-lite Clojure syntax. For
> example we can steal Python way of intending blocks.
> 
> 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))
> 
> could be written as
> 
> (set! python-style-op-op true)
> 
> defn qsort [[pivot & xs]]
>   when pivot
> let [smaller #(< % pivot)]
>   lazy-cat
> qsort
>   filter smaller xs
>   [pivot]
>   qsort
>   remove smaller xs
> 
> What do you think?
> 
> Isn't is less complex?
> 
> 
> P.S. Ok, I must confess, the mention of the C-Word in the last
> sentence was just a desperate way to get Rich's attention.
> 
> P.P.S. Actually I would also love to see Clojure community making
> video clip "Clojure - Python Style" as a remix for "G... Style", but
> this idea is probably way ahead of its time.
> 
> 
> Regards, Sergey.

Mikhail

-- 
-- 
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/groups/opt_out.




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 newcomers, I
doubt a python-like syntax will do. In the end, Syntax is just that.
Syntax. People get over it. (Even thought I still think S-Expressions
ARE a feature.)

In the end, have newcomers program in a bastardised version of
lisp/clojure to only then have them deal with S-Expressions misses the
entire point.

my 2c.

Cheers,
Leonardo Borges
www.leonardoborges.com


On Tue, Feb 5, 2013 at 10:50 AM, Mikhail Kryshen  wrote:
> 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 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 mean only the part of Lisp that is ... parentheses.
>>
>> I remember a number of people that mention parentheses as obstacles to
>> the wider Clojure adoption, in the Clojure space - in the Clojure
>> related discussions, even on this mailing list IIRC.
>>
>> But the number of people thinking this way outside the Clojure groups
>> is even bigger! We probably don't notice it because got immune to this
>> famous argument "it has too many parentheses" early when diving into
>> Clojure.
>>
>> I suggest there are a big number of people that could gain interest in
>> clojure if we provide them with parentheses-lite Clojure syntax. For
>> example we can steal Python way of intending blocks.
>>
>> 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))
>>
>> could be written as
>>
>> (set! python-style-op-op true)
>>
>> defn qsort [[pivot & xs]]
>>   when pivot
>> let [smaller #(< % pivot)]
>>   lazy-cat
>> qsort
>>   filter smaller xs
>>   [pivot]
>>   qsort
>>   remove smaller xs
>>
>> What do you think?
>>
>> Isn't is less complex?
>>
>>
>> P.S. Ok, I must confess, the mention of the C-Word in the last
>> sentence was just a desperate way to get Rich's attention.
>>
>> P.P.S. Actually I would also love to see Clojure community making
>> video clip "Clojure - Python Style" as a remix for "G... Style", but
>> this idea is probably way ahead of its time.
>>
>>
>> Regards, Sergey.
>
> Mikhail
>
> --
> --
> 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/groups/opt_out.
>
>

-- 
-- 
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/groups/opt_out.




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 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 newcomers, I
> doubt a python-like syntax will do. In the end, Syntax is just that.
> Syntax. People get over it. (Even thought I still think S-Expressions
> ARE a feature.)
>
> In the end, have newcomers program in a bastardised version of
> lisp/clojure to only then have them deal with S-Expressions misses the
> entire point.
>
> my 2c.
>
> Cheers,
> Leonardo Borges
> www.leonardoborges.com
>
>
> On Tue, Feb 5, 2013 at 10:50 AM, Mikhail Kryshen 
> wrote:
> > 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 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 mean only the part of Lisp that is ... parentheses.
> >>
> >> I remember a number of people that mention parentheses as obstacles to
> >> the wider Clojure adoption, in the Clojure space - in the Clojure
> >> related discussions, even on this mailing list IIRC.
> >>
> >> But the number of people thinking this way outside the Clojure groups
> >> is even bigger! We probably don't notice it because got immune to this
> >> famous argument "it has too many parentheses" early when diving into
> >> Clojure.
> >>
> >> I suggest there are a big number of people that could gain interest in
> >> clojure if we provide them with parentheses-lite Clojure syntax. For
> >> example we can steal Python way of intending blocks.
> >>
> >> 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))
> >>
> >> could be written as
> >>
> >> (set! python-style-op-op true)
> >>
> >> defn qsort [[pivot & xs]]
> >>   when pivot
> >> let [smaller #(< % pivot)]
> >>   lazy-cat
> >> qsort
> >>   filter smaller xs
> >>   [pivot]
> >>   qsort
> >>   remove smaller xs
> >>
> >> What do you think?
> >>
> >> Isn't is less complex?
> >>
> >>
> >> P.S. Ok, I must confess, the mention of the C-Word in the last
> >> sentence was just a desperate way to get Rich's attention.
> >>
> >> P.P.S. Actually I would also love to see Clojure community making
> >> video clip "Clojure - Python Style" as a remix for "G... Style", but
> >> this idea is probably way ahead of its time.
> >>
> >>
> >> Regards, Sergey.
> >
> > Mikhail
> >
> > --
> > --
> > 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/groups/opt_out.
> >
> >
>
> --
> --
> 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/groups/opt_out.
>
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" gr

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 and baz respectively. So the only cause of too-large methods is a 
single large lambda that doesn't delegate to other lambdas.

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. I don't know the details of how quoted 
values get put into the bytecode, but it's possible that code is emitted to 
generate them at runtime; perhaps they go into a static initializer, but 
that probably has the same code size limits anyway.

On Monday, February 4, 2013 2:53:04 PM UTC-8, Brian Marick wrote:
>
> 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 8 rows turns 
> into 8 individual facts (each of that structure), surrounded by an outer 
> level fact that runs each of them. This is wasteful of space but allows 
> unusually expressive tests. 
>
> Something I've done recently seems to have pushed some tabular facts over 
> the Java method-length limit: 
>
> > Caused by: java.lang.ClassFormatError: Invalid method Code length 81209 
> in class file midje/t_checkers$eval24254$this_function_here_24253__24497 
>
> (This is actually surprising, since I don't see what I've done today that 
> could push the size so *much* over 64K.) 
>
> I hope my two breaking tabular facts are atypically large, but I fear not. 
> So, some questions / thoughts: 
>
> 1. Do mutually recursive `letfn` functions get compiled into a single 
> method? More generally, I hope that any nested function definitions turn 
> into separate methods. Do they? 
>
> 2. The metadata is rather large - can it somehow end up increasing the 
> method bytecodes? What if it's constructed via merging literals, like this: 
>
>   (clojure.core/merge 
>'{:midje/body-source ((+ 1 1) => 2), ...} 
>{:midje/top-level-fact? true})))] 
>
> The guts of assertion checking also involves merging maps: 
>
> (check-one (clojure.core/merge 
> {:position 
>  :expected-result-form '2, 
>  :expected-result 2, 
>  :function-under-test (clojure.core/fn [] (+ 1 1))} 
> {:arrow '=>, :call-form '1} 
> (hash-map-duplicates-ok :position (line-number-known 2 
>
> 3. Midje goes to a lot of trouble to obey lexical scoping, so that you can 
> write, for example: 
>
> (let [a 2] 
>   (fact 
> (let [b 2] 
>   (+ a b) => (* a b))) 
>
> Do closed-over lexical environments contribute unduly to method size? 
>
> 4. How can I get a look at what a big fact compiles into? (I suppose I 
> need to AOT-compile a test namespace, but I've never had much luck with 
> that.) 
>
>  
> Looking for 1/2-time employment as a Clojure programmer 
> Latest book: /Functional Programming for the Object-Oriented Programmer/ 
> https://leanpub.com/fp-oo 
>
>

-- 
-- 
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/groups/opt_out.




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 
> in your project.clj but if you specify a full name and version that works 
> as well e.g. `lein open ring/ring-core 1.1.0`.
>
> lein-grep,  http://github.com/cldwalker/lein-grep, improves on the 
> default search by displaying one result per line in a well formatted table. 
> I recommend the readme to compare its output to `lein search`.
>
> Feedback welcome.
> Thanks,
> Gabriel
>

-- 
-- 
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/groups/opt_out.




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 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(smaller(xs()))
>
> I would also assert that Python complects formatting and semantic meaning 
> of the code. I'm quite proficient at Python and even I hate that fact. 
>
> Timothy
>
>
>
> On Mon, Feb 4, 2013 at 1:01 PM, Sergey Didenko 
> 
> > wrote:
>
>> 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 mean only the part of Lisp that is ... parentheses.
>>
>> I remember a number of people that mention parentheses as obstacles to
>> the wider Clojure adoption, in the Clojure space - in the Clojure
>> related discussions, even on this mailing list IIRC.
>>
>> But the number of people thinking this way outside the Clojure groups
>> is even bigger! We probably don't notice it because got immune to this
>> famous argument "it has too many parentheses" early when diving into
>> Clojure.
>>
>> I suggest there are a big number of people that could gain interest in
>> clojure if we provide them with parentheses-lite Clojure syntax. For
>> example we can steal Python way of intending blocks.
>>
>> 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))
>>
>> could be written as
>>
>> (set! python-style-op-op true)
>>
>> defn qsort [[pivot & xs]]
>>   when pivot
>> let [smaller #(< % pivot)]
>>   lazy-cat
>> qsort
>>   filter smaller xs
>> [pivot]
>> qsort
>>   remove smaller xs
>>
>> What do you think?
>>
>> Isn't is less complex?
>>
>>
>> P.S. Ok, I must confess, the mention of the C-Word in the last
>> sentence was just a desperate way to get Rich's attention.
>>
>> P.P.S. Actually I would also love to see Clojure community making
>> video clip "Clojure - Python Style" as a remix for "G... Style", but
>> this idea is probably way ahead of its time.
>>
>>
>> Regards, Sergey.
>>
>> --
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups 
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojure+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
> -- 
> “One of the main causes of the fall of the Roman Empire was that–lacking 
> zero–they had no way to indicate successful termination of their C 
> programs.”
> (Robert Firth) 
>

-- 
-- 
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/groups/opt_out.




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 :midje/source gets stored as the 
post-macroexpansion version, instead of the pre-macroexpansion. And 
:midje/body-source should be a SHA1 hash anyway.


Looking for 1/2-time employment as a Clojure programmer
Latest book: /Functional Programming for the Object-Oriented Programmer/
https://leanpub.com/fp-oo

-- 
-- 
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/groups/opt_out.




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:

http://docs.python.org/release/2.5.2/ref/delimiters.html

Clojure uses (), {}, #{}, [], quote, (.), back-quote, %,  #, #', #"", #(), \, 
;,  @, ^, ~, ~@ and _.
Maybe missing a couple here but not much time tonight to browse doc.

Aside from the parens, the interop call and the reader macro specific literals,
most of them are syntactic sugar.

You can write (hash-map ...) instead of {} and so forth.
You can write closures using (fn [a b] ...), no need to use #() and %n to refer 
to args.

Which brings me to my point that Clojure has no more essential delimiters than 
python,
maybe less (no time tonight to count). Except maybe if you write macros on a 
regular
basis.

This obsession about parenthesis misses the objective, to have less noise in 
the syntax
of the language.

Why twist Clojure if people are really searching for a better alternative to the
language they currently use ?

What about the ones that want a real improvement over their current situation ?
Why offer them a dual syntax with all the potential mess that such an approach
offers ?

How matching an algol like syntax makes Clojure more "acceptable" ?
If people just fly away because they heard that Clojure has too many 
parenthesis before
seriously trying it, well, excuse my comment, it's a lame excuse.

They will probably prefer to stick to what they have at hand, the parenthesis 
being the
less scary feature of Clojure :)

Luc P.






> 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 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(smaller(xs()))
> >
> > I would also assert that Python complects formatting and semantic meaning > 
> > > of the code. I'm quite proficient at Python and even I hate that fact > >
> > Timothy
> >
> >
> >
> > On Mon, Feb 4, 2013 at 1:01 PM, Sergey Didenko 
> > 
> > > wrote:
> >
> >> 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 mean only the part of Lisp that is ... parentheses.
> >>
> >> I remember a number of people that mention parentheses as obstacles to
> >> the wider Clojure adoption, in the Clojure space - in the Clojure
> >> related discussions, even on this mailing list IIRC.
> >>
> >> But the number of people thinking this way outside the Clojure groups
> >> is even bigger! We probably don't notice it because got immune to this
> >> famous argument "it has too many parentheses" early when diving into
> >> Clojure.
> >>
> >> I suggest there are a big number of people that could gain interest in
> >> clojure if we provide them with parentheses-lite Clojure syntax. For
> >> example we can steal Python way of intending blocks.
> >>
> >> 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))
> >>
> >> could be written as
> >>
> >> (set! python-style-op-op true)
> >>
> >> defn qsort [[pivot & xs]]
> >>   when pivot
> >> let [smaller #(< % pivot)]
> >>   lazy-cat
> >> qsort
> >>   filter smaller xs
> >> [pivot]
> >> qsort
> >>   remove smaller xs
> >>
> >> What do you think?
> >>
> >> Isn't is less complex?
> >>
> >>
> >> P.S. Ok, I must confess, the mention of the C-Word in the last
> >> sentence was just a desperate way to get Rich's attention.
> >>
> >> P.P.S. Actually I would also love to see Clojure community making
> >> video clip "Clojure - Python Style" as a remix for "G... Style", but
> >> this idea is probably way ahead of its time.
> >>
> >>
> >> Regards, Sergey.
> >>
> >> --
> >> --
> >> You received this message because you are subscribed to the Google
> >> Groups "Clojure" group.
> >> To post to this group, send email to clo...@googlegroups.com
> >> Note that posts from new members are moderated - please be patient with > 
> >> >> your first post.
> >> To unsubscribe from this group, send email to
> >> clojure+u...@googlegr

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 
better. My only complaint is that I have to press the shift key to type 
them.

I'm also teaching Racket to High School students. The simple regular syntax 
of Racket is much easier for them to learn than Java, which I taught a 
couple of years ago. They seldom have problems with syntax errors in 
Racket, but they did all the time in Java. Teaching with Racket, I can 
focus on logic and design rather than syntax. Since most of my students 
have done very little programming before, they are not scared by the 
parentheses.

So, I've come to the conclusion that parenthesis-hate is just prejudice. 
Lisps don't look like the languages people already know. Python actually 
fights the same kind of problem with people who come from the C/Java world 
because significant whitespace is different from what they are used to. And 
in the old days when I first learned C, most people were used to Fortran, 
Cobol, Basic, and Pascal, and they complained about the curly-braces and 
terseness of C.

If someone wants to create a no-parenthesis version of Clojure, that would 
be fine, but it wouldn't be Clojure. Many of the good qualities of Clojure 
would work in a non-Lisp language, and it might develop a following. 
However, I don't think you will find many people who currently like Clojure 
to be interested in doing the work because they probably like the 
parentheses. Why should they spend time creating another language when you 
like what you have?

-- 
-- 
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/groups/opt_out.




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 unbalanced 
parentheses all the time. Even so, he apparently prefers tripping up to 
switching to a different editor like emacs. I guess people have their one 
favorite editor which they want to use for everything.

Long story short: want more people to love lisp? Implement paredit for more 
editors.

-- 
-- 
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/groups/opt_out.




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

Software system design, development, and documentation


-- 
-- 
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/groups/opt_out.




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
>

-- 
-- 
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/groups/opt_out.




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 registered with it). I need to add to and remove from 
this Set regularly to process new connections, reads, and writes. Is this 
just a situation of needing to isolate I/O from other parts of my Clojure 
program, or are there additional techniques to keep in mind when working 
with collections like selected-keys? Thanks for any feedback. 

-- 
-- 
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/groups/opt_out.