While in another answer to this post, I said I had in mind to experiment
with such a thing when time permits on clojure-dev, I've then followed some
links, seen some attempts to remove parentheses ...

... and was very surprised to feel a little "losts" without the parenthesis
on the examples ! :-)

Anyway, since clojure-dev colorizes parenthesis depending on how deep they
are in the hierarchy, I think it's not even painfull at all to live with
parenthesis.
See this snapshot for an example :
http://code.google.com/p/clojure-dev/wiki/ScreenShots#Source_code_Editor

I know also of gorilla (vim plugin), and certainly emacs (not sure about
enclojure, though) that offer parens colorizing (also named rainbow parens).

Concerning the debate : should this be "just an IDE trick" to remove parens,
or "a preprocessor", I'm very very against the idea of a preprocessor, for
all the reasons other people have said about it : because it will inevitably
lock beginners into something that is not really clojure, they won't be able
to easily share libraries, they will feel bad when reading "real clojure"
libraries code.
In the other end, I think a bidirectional translator could be interesting in
an IDE to visually help people, from time to time.

My 0,02 €,

-- 
Laurent

2009/2/23 Mark Volkmann <r.mark.volkm...@gmail.com>

>
> I have an idea I'd like to float to see if there are reasons why it's
> a bad idea.
>
> What if Clojure had an alternate "surface" syntax that was translated
> into standard Clojure syntax by a kind of preprocessor?
>
> Many people that don't like Lisp dialects don't like them because of
> the parentheses. I'm trying to address that.
>
> Here's a simple example of valid Clojure code.
>
> (defn pig-latin [word]
>  (let [first-letter (first word)]
>    (if (.contains "aeiou" (str first-letter))
>      (str word "ay")
>      (str (subs word 1) first-letter "ay"))))
>
> (println (pig-latin "red"))
> (println (pig-latin "orange"))
>
> Here's what that same code would look like in my alternate syntax.
>
> defn pig-latin [word]
>  let [first-letter (first word)]
>    if .contains "aeiou" (str first-letter)
>      str word "ay"
>      str (subs word 1) first-letter "ay"
>
> println (pig-latin "red")
> println (pig-latin "orange")
>
> The rules for turning this into standard Clojure syntax are pretty simple.
>
> 1) If a line is indented farther than the previous one, it is part of
> the previous line.
> 2) If a line doesn't start with a (, then add one.
> 3) If the next line is indented less than this one, add the
> appropriate number of )'s at the end.
> 4) If the first token on a line is "if" and the first non-whitespace
> character after it is not (
>    then assume the rest of the line is the condition and wrap it in ( ).
>
> A translation from standard Clojure syntax to this alternate form
> should also be possible.
>
> Is this a bad idea?
>
> --
> R. Mark Volkmann
> Object Computing, Inc.
>
> >
>

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

Reply via email to