Re: Parenthesis Inference

2009-12-19 Thread ajay gopalakrishnan
Precedence is an overrated thing. You dont run into that issue every day. When we do we have the support of (). So, a developer must have the option to disambiguate it when necessary, but otherwise should not have to type the otherwise redundant () all the time. (All this talk is about arithmetic e

Re: Parenthesis Inference

2009-12-19 Thread Alex Osborne
ajay gopalakrishnan writes: > If possible, I would also want to see a macro that allows me to write (x < y) > instead of  (< x y). Here's Chouser's infix function, which he apparently has never used since writing it: http://paste.lisp.org/display/75230 > (+ x y) can be read literally as "add

Re: Parenthesis Inference

2009-12-19 Thread Richard Newman
> (< x y) how do you read this literally left-to-right? I've been writing Common Lisp and Clojure for about 6 years now, and I read that "less-than x y" without any confusion. I have almost no problems with prefix notation; even arithmetic (which I was taught in infix for years) rarely trips

Re: Parenthesis Inference

2009-12-19 Thread ajay gopalakrishnan
Yes, Martin, please give it a try. Only then can we know if the parenthesis is real issue or not. There is no point arguing about it. The only disadvantage is that, over time, people will forget that it is actually a list. But, hey, if it does not prevent us from writing efficient and correct code

clojure.contrib.error-kit bug?

2009-12-19 Thread Brian Carper
(defn- special-form [form] (and (list form) (symbol? (first form)) (#{#'handle #'bind-continue} (resolve (first form) I think the second line should say (list? form). (list form) is always true. --Brian -- You received this message because you are subscribed to the Google

Re: Parenthesis Inference

2009-12-19 Thread ajay gopalakrishnan
> Is it possible that people are confusing their inability to comprehend > deeply nested function calls (no offense intended by that - I hit this > often myself) with the strangeness of the perens? I think what others > have said about having to think more about each line of Clojure is > true. It

Re: Parenthesis Inference

2009-12-19 Thread Sean Devlin
Give it a shot. Hack up a prototype. Let's see what happens. On Dec 20, 12:07 am, "Alex Osborne" wrote: > Phil Hagelberg writes: > > "Alex Osborne" writes: > >> But this is the same "great idea" that everyone who's ever used a lisp > >> since the dawn of programming has come up with and despi

Re: Parenthesis Inference

2009-12-19 Thread Alex Osborne
Phil Hagelberg writes: > "Alex Osborne" writes: >> But this is the same "great idea" that everyone who's ever used a lisp >> since the dawn of programming has come up with and despite numerous >> attempts, to my knowledge not a single one of them has ever taken off. > > You're forgetting about D

Re: A tale of cond, clauses, and the docs

2009-12-19 Thread Mike K
On Dec 19, 8:27 pm, Sean Devlin wrote: >  :else was chose because it is simply not nil, and therefor always true. I suspected something along these lines soon after I posted. I did some more experimenting and discovered that :foo will work just as well as :else. So if I understand correctly, :e

Re: Parenthesis Inference

2009-12-19 Thread Brandon Mason
Is it possible that people are confusing their inability to comprehend deeply nested function calls (no offense intended by that - I hit this often myself) with the strangeness of the perens? I think what others have said about having to think more about each line of Clojure is true. It is more e

Re: Advice for someone coming from an OO world?

2009-12-19 Thread Mike Meyer
On Fri, 18 Dec 2009 08:55:13 -0800 (PST) IslandRick wrote: > Can anyone here offer some advice to those who are too ingrained in > using an object-oriented hammer on every nail they see? I know Rich > and Stuart have some good design examples around (I've read many), but > if there are any tutori

Re: Parenthesis Inference

2009-12-19 Thread Mike Meyer
On Sat, 19 Dec 2009 14:22:22 + Martin Coxall wrote: > On 19 Dec 2009, at 13:50, Stefan Kamphausen wrote: > > * Reason. They could have been taken away in more than 50 years of > > history. Guess what, they are still there. > Guess what? NOBODY uses Lisp. Because of those parens. You've over

Re: Parenthesis Inference

2009-12-19 Thread ajay gopalakrishnan
I think this discussion is getting too long, but anyway .. Coming from an imperative background, especially Java which is a lot bloated, when I tried to read Lisp code, I start to get the feeling that I am staring at the same place for a long time. In an imperative setting, it definitely means tha

Re: bug or feature in (require ...)?

2009-12-19 Thread Meikel Brandmeyer
Hi, Am 18.12.2009 um 19:43 schrieb Alex Ott: > Question - this is feature of require? or this is a bug? The current require cannot handle this situation. You will have to reload all namespaces with :reload in the right order manually. See here for more on this issue: http://groups.google.com/g

Re: Parenthesis Inference

2009-12-19 Thread Charras
can't believe, you guys, WAIST! your time discussing about parentheses. There are far more interesting things to discuss. Please don't waist time (time is life, is all we have) in that, and specially, this is a public group, where knowledge should be share, not nonsense discussions. If somebody l

Re: A tale of cond, clauses, and the docs

2009-12-19 Thread Sean Devlin
Ah, :else is an unfortunate choice. The cond macro keeps testing clauses until it finds one that is true. :else was chose because it is simply not nil, and therefor always true. I would re-write your fn like so: (defn sign [x] (cond (> x 0) "Positive" (< x 0) "Negative" true "Zero")) Sean On

A tale of cond, clauses, and the docs

2009-12-19 Thread Mike K
What, exactly, is a "clause" in clojure? From seeing the term used in context, I inferred that it meant something along the lines of "a keyword which can optionally be used to change the semantics of a form". Apparently, it means more than that. This is valid clojure: (defn sign [x] (cond (> x

Re: Parenthesis Inference

2009-12-19 Thread Phil Hagelberg
"Alex Osborne" writes: >> But I'm trying to think of it from the point of view of Joe Q. Coder, >> who will take one look at our beloved elegant, expressive Clojure, see >> all the parens and run screaming. > But this is the same "great idea" that everyone who's ever used a lisp > since the dawn

Re: Transient Bug

2009-12-19 Thread Chouser
On Sat, Dec 19, 2009 at 10:30 AM, Sean Devlin wrote: > Steve, > I've been checking out the Java, and it looks the same to me.  I think > this raises a couple issues: > > 1.  Should sorted versions get transient support in 1.1? > 2.  The docs should be updated to reflect the 1.1 status of > transie

Re: let-binding overrides binding-binding

2009-12-19 Thread Stephen C. Gilardi
On Dec 19, 2009, at 5:23 PM, Stefan Kamphausen wrote: > 1. Is my explanation correct? It is. The binding form operates on the var, it doesn't affect name resolution within the binding form's body. *val* within the body of the binding still resolves to the let-bound local. While *val* is shadow

Re: Parenthesis Inference

2009-12-19 Thread Alex Osborne
Martin Coxall writes: > I trust the many, many more people that have rejected Lisp for its > hostile syntax and delusions of importance than the statistically > insignificant minority who have actually stuck with it. Sometimes people are just looking for excuse to criticize. Before it was cons

Re: Leiningen in Python

2009-12-19 Thread Phil Hagelberg
John writes: > I am trying to use lein.py, from above, on Windows (Vista). > But I still have the following error with the 'lein.py install' and > 'lein.py jar' commands: I don't know Python myself, so I will wait until I hear about these being resolved before I check this in. -Phil -- You re

Re: leiningen with latest clojure

2009-12-19 Thread Phil Hagelberg
Andrea Tortorella writes: > Yes, I'd like to use the new branch not the master one, anyway having > this dependency in project.clj: > > [org.clojure/clojure "1.1.0-new-SNAPSHOT"] > > and using lein repl, I still have 1.1.0-alpha-SNAPSHOT at the repl. That's a bug. Currently due to I/O limitation

Re: Parenthesis Inference

2009-12-19 Thread Joost
On 19 dec, 15:25, Martin Coxall wrote: > > I guess it's mostly a matter of judging a language by its long-term > > merits instead of initial appearance -- just like with so many other > > things in life. > > That - right there - is a tacit admission that the Clojure community will > find it activ

Re: popping optional args from the front

2009-12-19 Thread Sean Devlin
Occasionally I have to write a custom def macro, and this would make life easier. I would have to use it to provide specific feedback, but it seems like an idea worth pursuing. On Dec 19, 3:58 pm, Stuart Halloway wrote: > In Clojure it is idiomatic to have optional args at the front of the   >

Re: Leiningen in Python

2009-12-19 Thread Rob Wolfe
John writes: > Hi, > > I am trying to use lein.py, from above, on Windows (Vista). > > It works nicely for some commands (e.g. lein.py compile), > after removing the extra space in two places e.g. > 'leiningen-%s-standalone .jar' -> > 'leiningen-%s-standalone.jar' > and > '1.1.0-alpha-SNAPSHOT/cl

let-binding overrides binding-binding

2009-12-19 Thread Stefan Kamphausen
Hi, just found that a binding-form within a let-form does still use the outer value. user> (def *val* "root binding") #'user/*val* user> (defn print-val [] (println "*val* is: " *val*)) #'user/print-val user> (defn let-vs-binding [] (println "beginning: " *val*) (let [*val* "bound

Re: Advice for someone coming from an OO world?

2009-12-19 Thread Joost
Oh and another thing: In my experience, it's easier to start by putting all the code in a single package, and only split it up once you get to a level of complexity that really demands splitting it up. Emacs/SLIME (and probably other interactive environments) really help too: once you've written/

Re: Advice for someone coming from an OO world?

2009-12-19 Thread Joost
On 18 dec, 17:55, IslandRick wrote: > Can anyone here offer some advice to those who are too ingrained in > using an object-oriented hammer on every nail they see?  I know Rich > and Stuart have some good design examples around (I've read many), but > if there are any tutorials that show how to re

Re: Maven2 repo URL required for Clojure 1.1 RC

2009-12-19 Thread Alex Osborne
Shantanu Kumar writes: > Could anybody please give me a Clojure 1.1 Maven2 repo URL? It's not > there on Maven central repo yet, and (surprise!) clojars.org doesn't > seem to have it either. http://build.clojure.org/snapshots/ -- You received this message because you are subscribed to the Goog

popping optional args from the front

2009-12-19 Thread Stuart Halloway
In Clojure it is idiomatic to have optional args at the front of the signature. This makes it easy to define convenient caller APIs, but it leads to bulky let forms like this one (from clojure.core/defmulti) (let [docstring (if (string? (first options)) (first optio

Re: Parenthesis Inference

2009-12-19 Thread Sean Devlin
Well, good thing you repented of your evil ways On Dec 19, 3:37 pm, Stuart Sierra wrote: > On Dec 18, 9:28 pm, Sean Devlin wrote: > > > It is proudly a Lisp for people that want to get things done.  Any > > Java/.NET/Python/Brainfuck/Ruby/Basic/C/C++ (No Perlmongers :)) > > I was a Perlmonge

Re: 1.1 changes.txt typo

2009-12-19 Thread Stuart Sierra
On Dec 18, 9:03 am, David Thomas Hume wrote: > From the 1.1 release notes: > > "Futures represent asynchronous computations. They are away to get > code to run in another thread, and obtain the result." That's been fixed now in the 1.1.x branch; thanks for the report. -SS -- You received this m

Re: Parenthesis Inference

2009-12-19 Thread Stuart Sierra
On Dec 18, 9:28 pm, Sean Devlin wrote: > It is proudly a Lisp for people that want to get things done.  Any > Java/.NET/Python/Brainfuck/Ruby/Basic/C/C++ (No Perlmongers :)) I was a Perlmonger back in the day. :) -SS -- You received this message because you are subscribed to the Google Groups

Parentheses

2009-12-19 Thread ddyer
Parens are really a non-issue once you are using an editor that counts them and highlights matching appropriately. -- 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 m

Re: Parenthesis Inference

2009-12-19 Thread Mark Engelberg
On Sat, Dec 19, 2009 at 9:21 AM, David Nolen wrote: > I don't think anybody in the Clojure community wants to Clojure to be a > fringe language. Actually, I don't mind if Clojure retains a certain degree of "fringe" status. To clarify, I think the ideal size for a language community is somewhere

Re: Parenthesis Inference

2009-12-19 Thread ajay gopalakrishnan
The intended audience are Software Engineers. Not the people who hide behind "this-is-not-intuitive" their lack of willing to learn the most effective way to spend their professional life. Why is it that you believe them to be mutually exclusive events? You portray Software engineers as if they ar

Maven2 repo URL required for Clojure 1.1 RC

2009-12-19 Thread Shantanu Kumar
Hi, Could anybody please give me a Clojure 1.1 Maven2 repo URL? It's not there on Maven central repo yet, and (surprise!) clojars.org doesn't seem to have it either. I am going to use the 1.1 RC JAR in my local repo until I find one. Regards, Shantanu -- You received this message because you a

Re: Parenthesis Inference

2009-12-19 Thread Joseph Smith
Oops.. left two parentheses out in my Java code. Guess that just furthers my point. :) > List newObjects = ArrayList(); On Dec 19, 2009, at 12:04 PM, Joseph Smith wrote: > Very abstract java example (as concise as possible): > > List processList(List oldObjects) > { >List newObjects

Re: Parenthesis Inference

2009-12-19 Thread Joseph Smith
Very abstract java example (as concise as possible): List processList(List oldObjects) { List newObjects = ArrayList; for(Object object : oldObjects) { newObjects.add(manipulate(object)); } return newObjects; } Clojure equivalent: (defn processList [#^Object list]

Re: Parenthesis Inference

2009-12-19 Thread Sean Devlin
Martin, I was short with you yesterday. I'm sorry about that. Please let me try again. I'm all for providing better documentation, eliminating bad design, and holding hands as people get up to speed. As a community, we constantly need to do more work to make it accessible. That's the point of

Re: Parenthesis Inference

2009-12-19 Thread David Nolen
On Sat, Dec 19, 2009 at 8:25 AM, Martin Coxall wrote: > > > > I guess it's mostly a matter of judging a language by its long-term > > merits instead of initial appearance -- just like with so many other > > things in life. > > > > That - right there - is a tacit admission that the Clojure communi

Re: Parenthesis Inference

2009-12-19 Thread Martin Coxall
> > I guess it's mostly a matter of judging a language by its long-term > merits instead of initial appearance -- just like with so many other > things in life. > That - right there - is a tacit admission that the Clojure community will find it actively desirable that it remain a minority langu

Re: leiningen with latest clojure

2009-12-19 Thread Andrea Tortorella
Thanks for your answers. Yes, I'd like to use the new branch not the master one, anyway having this dependency in project.clj: [org.clojure/clojure "1.1.0-new-SNAPSHOT"] and using lein repl, I still have 1.1.0-alpha-SNAPSHOT at the repl. I added the spec to the dev-dependencies too, but still ha

Re: Leiningen in Python

2009-12-19 Thread John
Hi, I am trying to use lein.py, from above, on Windows (Vista). It works nicely for some commands (e.g. lein.py compile), after removing the extra space in two places e.g. 'leiningen-%s-standalone .jar' -> 'leiningen-%s-standalone.jar' and '1.1.0-alpha-SNAPSHOT/cloju re-1.1.0-alpha-SNAPSHOT.jar'

Re: OnLisp: Porting Chapter 19 to Clojure

2009-12-19 Thread mk
Thanks! I found this one, it involves a function that does the resolve: (defn -dynlet [bvec body] `(let ~bvec ~body)) (defmacro dynlet [bvec body] `(eval (-dynlet ~bvec ~body))) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this gr

Re: Call for masters thesis ideas (possibly related to Clojure)

2009-12-19 Thread Patrick Kristiansen
I want to thank you all for your suggestions, the clojure community is really great! On Dec 18, 1:35 pm, Patrick Kristiansen wrote: > Hi > > We're two students that have been working with concurrent programming > languages (Erlang and Clojure), and while both languages are very > interesting, we

Re: Parenthesis Inference

2009-12-19 Thread Martin Coxall
On 19 Dec 2009, at 13:50, Stefan Kamphausen wrote: > Hi, > > On 18 Dez., 20:07, Martin Coxall wrote: >> One of the things that always puts people off of Lisp, as we all know, are >> the parentheses. > > one of the things that always put Lispers off is this same question. > > I have three arg

Re: Parenthesis Inference

2009-12-19 Thread Martin Coxall
> > > It is proudly a Lisp for people that want to get things done. Any > Java/.NET/Python/Brainfuck/Ruby/Basic/C/C++ (No Perlmongers :)) that > want to get better are welcome. However, there is a way things are > done in the language, driven by the underlying problems reality > imposes on deve

Re: Call for masters thesis ideas (possibly related to Clojure)

2009-12-19 Thread Jules
Predicate dispatch would be an interesting topic. The #1 problem with predicate dispatch is method ordering. Predicate dispatch as described in the orignal paper [http://www.cs.washington.edu/homes/mernst/pubs/ dispatching-ecoop98-abstract.html] decides what order to used based on implication betwe

Re: 1.1 changes.txt typo

2009-12-19 Thread Daniel Werner
On Dec 18, 3:03 pm, David Thomas Hume wrote: > From the 1.1 release notes: > > "Futures represent asynchronous computations. They are away to get > code to run in another thread, and obtain the result." > > I know "away" is just a typo for "a way", but be damned if that isn't > the best pun I've s

Re: Transient Bug

2009-12-19 Thread Sean Devlin
Steve, I've been checking out the Java, and it looks the same to me. I think this raises a couple issues: 1. Should sorted versions get transient support in 1.1? 2. The docs should be updated to reflect the 1.1 status of transients. Sean On Dec 19, 10:23 am, "Stephen C. Gilardi" wrote: > > I

Re: Parenthesis Inference

2009-12-19 Thread Erik Price
Personally, I don't think the problem for non-Lispers is with the number of parentheses so much as with the *depth* of parens-nesting and having to invert the reading order, starting from the deepest s-expr and reading your way back out. I'm still very new to Clojure (basically I have only been pa

Re: Transient Bug

2009-12-19 Thread Stephen C. Gilardi
> I was experimenting with transients, and they don't seem to work for > sorted collections: > > user=> (transient (sorted-map 1 2 3 4)) > java.lang.ClassCastException: clojure.lang.PersistentTreeMap cannot be > cast to clojure.lang.IEditableCollection (NO_SOURCE_FILE:0) > > user=> (transient (s

Re: Transient Bug

2009-12-19 Thread David Nolen
IIRC, you can use transient only with maps and vectors. David On Sat, Dec 19, 2009 at 8:46 AM, Sean Devlin wrote: > Hey, > I was experimenting with transients, and they don't seem to work for > sorted collections: > > user=> (transient (sorted-map 1 2 3 4)) > java.lang.ClassCastException: clojur

Transient Bug

2009-12-19 Thread Sean Devlin
Hey, I was experimenting with transients, and they don't seem to work for sorted collections: user=> (transient (sorted-map 1 2 3 4)) java.lang.ClassCastException: clojure.lang.PersistentTreeMap cannot be cast to clojure.lang.IEditableCollection (NO_SOURCE_FILE:0) user=> (transient (sorted-set 1

Re: Parenthesis Inference

2009-12-19 Thread Daniel Werner
On Dec 18, 8:07 pm, Martin Coxall wrote: > I had this thought at work, when I should have been working, so please bear > with me if it's nonsense. > > One of the things that always puts people off of Lisp, as we all know, are > the parentheses. Now, many ways have been suggested of doing this in

Re: Call for masters thesis ideas (possibly related to Clojure)

2009-12-19 Thread Patrick Kristiansen
On Dec 19, 1:52 am, ajay gopalakrishnan wrote: > Put > > *Comparative performance evaluation of Java threads for embedded > applications**: Linux thread vs. Green thread Your Google search skills are obviously beyond ours. :) I've found it now. -- You received this message because you are subsc

Re: Parenthesis Inference

2009-12-19 Thread Stefan Kamphausen
Hi, On 18 Dez., 20:07, Martin Coxall wrote: > One of the things that always puts people off of Lisp, as we all know, are > the parentheses. one of the things that always put Lispers off is this same question. I have three arguments to make. Love, reason and trust. * Love. Parentheses are an

Re: Parenthesis Inference

2009-12-19 Thread Laurent PETIT
It's certainly something I would like to add to counterclockwise. If only paredit's code was written in clojure, it could have been more easily reused by enclojure, La Clojure and counterclockwise ! :-( 2009/12/19 Avital Oliver > It seems that noone has brought up the amazing paredit mode for

Re: Call for masters thesis ideas (possibly related to Clojure)

2009-12-19 Thread Micklat
How about static analysis? Plenty of interesting problems there. For example: 1. detect incorrect uses of transients (those that would certainly lead to exceptions) and report them during compile-time. 2. related to (1), but different: detect places where the compiler can implicitly convert colle

Re: Parenthesis Inference

2009-12-19 Thread Avital Oliver
It seems that noone has brought up the amazing paredit mode for emacs which gives you keyboard commands for s-expression structure manipulation. It also makes sure you never get your close parenthesis wrong. I use it and can't imagine writing any medium+-complexity code without it. On Dec 19, 2009

Re: Advice for someone coming from an OO world?

2009-12-19 Thread Laurent PETIT
If you could share more detail, the end result of helping you could be interesting : both versions (OOP & clojure) of a same program. 2009/12/18 IslandRick > Up until a month ago, my total Lisp experience consisted of hacking > my .emacs file to bend it to my will -- a lot. Discovering Clojure

Re: Call for masters thesis ideas (possibly related to Clojure)

2009-12-19 Thread jng27
What about adding circular dependency resolution to the compiler between Clojure -> Java code ? I know, I know - it's not very sexy but it would go a long way for companies with larger legacy Java code bases that may be considering moving to Clojure. Being able to replace Java code 'one step at a