Re: How about write clojure code like python mode?
On Aug 27, 2009, at 9:45 AM, Richard Newman wrote: > One reason for it not catching on is probably that anyone who's > learned enough Lisp to implement it has become comfortable enough with > parens to not use it. The same applies for the newbie who decides to > learn enough to start implementing... > > The same goes for infix (particularly infix math). There are a bunch > of implementations out there, none of which see much use. I side with the Lisp curmudgeon sect but would like to point out a few exceptions to the rule. First, the language Dylan, which started out with Lisp syntax but later on they decided to switch from S-exps to M-exps (so to speak) for marketing purposes: http://en.wikipedia.org/wiki/Dylan_(programming_language)#Syntax SRFI 49 brings this feature to Scheme: http://srfi.schemers.org/srfi-49/srfi-49.html I don't know how widely supported SRFI 49 is by various Scheme implementations or how many programmers actually program with it. I suspect "not much" and "very few." — Daniel Lyons --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: How about write clojure code like python mode?
One reason for it not catching on is probably that anyone who's learned enough Lisp to implement it has become comfortable enough with parens to not use it. The same applies for the newbie who decides to learn enough to start implementing... The same goes for infix (particularly infix math). There are a bunch of implementations out there, none of which see much use. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: How about write clojure code like python mode?
its not impossible, it just isn't terribly useful. On Aug 26, 6:04 pm, Laurent PETIT wrote: > "they didn't know it was impossible so they did it" :) > > 2009/8/26 Stuart Sierra > > > > > On Aug 24, 11:23 pm, wangzx wrote: > > > I think clojure may mix both the parenthese and python-like indent > > > together. > > > This has been attempted about every six months ever since Lisp was > > invented. It never caught on. > > > -SS > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: How about write clojure code like python mode?
"they didn't know it was impossible so they did it" :) 2009/8/26 Stuart Sierra > > On Aug 24, 11:23 pm, wangzx wrote: > > I think clojure may mix both the parenthese and python-like indent > > together. > > This has been attempted about every six months ever since Lisp was > invented. It never caught on. > > -SS > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: How about write clojure code like python mode?
On Aug 24, 11:23 pm, wangzx wrote: > I think clojure may mix both the parenthese and python-like indent > together. This has been attempted about every six months ever since Lisp was invented. It never caught on. -SS --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: How about write clojure code like python mode?
I am two sided about this. I hope that there exists a nice easy translation from block-indentation code to parenthesis-ridden code. As it stands however, the current solutions are more hassle than they're worth. I don't want to be misinterpreted as saying that I wouldn't desire such a feature. I really do. But the current solutions are just not good enough yet. After almost a year, and two big projects later, I still have to copy- and-paste lisp code into my Emacs environment to make any sense out of it. -Patrick --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: How about write clojure code like python mode?
It might sound good to someone new to Clojure, and Lisp as a whole, but you could ask almost any experienced Lisper, and he'll gladly tell you that he believes the parentheses only serve to make the code more readable. It looks weird coming from another language, but once you've used the parentheses for a while with a good editor like Emacs that helps you match parentheses, you'll begin to love them. On Aug 24, 10:23 pm, wangzx wrote: > (defn hello > "Writes hello message to *out*. Calls you by username. > Knows if you have been here before." > [username] > (dosync > (let [past-visitor (@visitors username)] > (if past-visitor > (str "Welcome back, " username) > (do > (alter visitors conj username) > (str "Hello, " username) ) ) ) ) ) > > The code is copied from book "Programming Clojure", I think the ) is > too much for reading. So, can we using the following style: > > defn hello [username] > dosync > let [past-visitor (@visitors username)] > if past-visitor > str "welcome back, " username > do > alter visitors conj username > str "Hello, " username > > The line indent contains the parenthesis and it looks it is much > friendly for ready. > > I think clojure may mix both the parenthese and python-like indent > together. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: How about write clojure code like python mode?
> 2. It is NOT simple to do, and IMO unjustified complexity. Maybe it's > simple to implement superficially, but there would be some ugly, > inevitable warts, I think? Furthermore, you cannot eliminate all uses of parentheses — fns, nested calls, let blocks, etc — so what's the point? Python has parentheses, it just doesn't have {}s… and it has crippled features (such as one-line lambdas) as a result. Lisps have minimal syntax, and after a few weeks of using one you'll probably end up preferring the style to those of other languages. There are reasons why Lisp ended up with what was originally intended to be an intermediate syntax. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: How about write clojure code like python mode?
2009/8/24 wangzx : > > (defn hello > "Writes hello message to *out*. Calls you by username. > Knows if you have been here before." > [username] > (dosync > (let [past-visitor (@visitors username)] > (if past-visitor > (str "Welcome back, " username) > (do > (alter visitors conj username) > (str "Hello, " username) ) ) ) ) ) > > The code is copied from book "Programming Clojure", I think the ) is > too much for reading. So, can we using the following style: > > defn hello [username] > dosync > let [past-visitor (@visitors username)] > if past-visitor > str "welcome back, " username > do > alter visitors conj username > str "Hello, " username > > The line indent contains the parenthesis and it looks it is much > friendly for ready. > > I think clojure may mix both the parenthese and python-like indent > together. > Sorry, I think it's a bad idea. Clojure is not Python! To be clear, I like the idea of indentation-as-block-delimiters, but I like it in Python (and would like to see it in other imperative programming languages). I think it's a bad idea to implement it in Clojure for a number of reasons: 1. Clojure is LISP, and LISP's about parentheses! 2. It is NOT simple to do, and IMO unjustified complexity. Maybe it's simple to implement superficially, but there would be some ugly, inevitable warts, I think? 3. I see no pragmatic reason to implement a more complex parser and impose a coding style that could be quite different to what Lispers (or Clojurers) are acostumed to. I don't really see it more legible than lisps parentheses. I SEE, however, how it could make some other code (imperative paradigm, mainly) cleaner. -- Patrick Steiger. "Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why. Programmers combine theory and practice: Nothing works and they don't know why." - Anon --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: How about write clojure code like python mode?
Hi, On Aug 25, 3:29 pm, Baishampayan Ghose wrote: > It's easy to say, but try imagining how macros will be written when > there are no parentheses. Just as before. Macros act on the Clojure structures. So if you have a reader which is able to read in the "whitespace syntax", the resulting structures can be passed on to the Compiler (and hence the macro machinery) just as structures, which come from the usual reader. Sincerely Meikel --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: How about write clojure code like python mode?
On Mon, Aug 24, 2009 at 11:23 PM, wangzx wrote: > > (defn hello > "Writes hello message to *out*. Calls you by username. > Knows if you have been here before." > [username] > (dosync > (let [past-visitor (@visitors username)] > (if past-visitor > (str "Welcome back, " username) > (do > (alter visitors conj username) > (str "Hello, " username) ) ) ) ) ) > > The code is copied from book "Programming Clojure", I think the ) is > too much for reading. So, can we using the following style: > > defn hello [username] > dosync > let [past-visitor (@visitors username)] > if past-visitor > str "welcome back, " username > do > alter visitors conj username > str "Hello, " username > > The line indent contains the parenthesis and it looks it is much > friendly for ready. > > I think clojure may mix both the parenthese and python-like indent > together. Sounds like you're describing this project: http://github.com/onyin/pleajure/tree/master --Chouser --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: How about write clojure code like python mode?
wangzx wrote: > (defn hello > "Writes hello message to *out*. Calls you by username. > Knows if you have been here before." > [username] > (dosync > (let [past-visitor (@visitors username)] > (if past-visitor > (str "Welcome back, " username) > (do > (alter visitors conj username) > (str "Hello, " username) ) ) ) ) ) > > The code is copied from book "Programming Clojure", I think the ) is > too much for reading. So, can we using the following style: > > defn hello [username] > dosync > let [past-visitor (@visitors username)] > if past-visitor > str "welcome back, " username > do > alter visitors conj username > str "Hello, " username > > The line indent contains the parenthesis and it looks it is much > friendly for ready. > > I think clojure may mix both the parenthese and python-like indent > together. It's easy to say, but try imagining how macros will be written when there are no parentheses. I think the parentheses help a lot in lending homoiconicity to Clojure and other Lisps. Moreover, when you use a decent Lisp-aware editor parentheses usually vanish in thin air. All you care about then is the indentation. Regards, BG -- Baishampayan Ghose oCricket.com signature.asc Description: OpenPGP digital signature
Re: How about write clojure code like python mode?
Hi, if you are an emacs user, this might be interesting for you: http://www.foldr.org/~michaelw/emacs/ (Scroll down to mwe-color-box.el, with screenshot) Sincerely Meikel --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---