Re: Lisp/Clojure doesn't have syntax?

2008-12-12 Thread evins.mi...@gmail.com
On Dec 11, 3:58 pm, Randall R Schulz rsch...@sonic.net wrote: On Thursday 11 December 2008 13:47, Sean Spencer wrote: That was one of the best explanations of code as data I've ever read. Kudos! Thanks. You forced me to look up the reference to which I alluded: On Thursday 11 December

Re: Lisp/Clojure doesn't have syntax?

2008-12-12 Thread Rich Hickey
On Dec 12, 1:35 am, Mon Key s...@derbycityprints.com wrote: Clojure does not allow for programmer-defined reader macros (unlike other lisps). I know this has been touched upon last Spring - and Stu Halloway refs at least one discussion of this in his book. From a practical standpoint I

Re: Lisp/Clojure doesn't have syntax?

2008-12-12 Thread Mark Volkmann
On Thu, Dec 11, 2008 at 3:44 PM, Randall R Schulz rsch...@sonic.net wrote: Punctuation is not syntax. Clojure goes on to add a lot of syntax. The literal syntax for vectors [], maps {}, sets #{}, functions #(), keywords :, etc. are all syntax, not possible with macros, and then there are

Re: Lisp/Clojure doesn't have syntax?

2008-12-12 Thread r
On Fri, Dec 12, 2008 at 1:38 PM, Mark Volkmann r.mark.volkm...@gmail.com wrote: I really have trouble understanding the idea that punctuation and syntactic sugar shouldn't be considered syntax. S-Expressions and its counterparts are technically a syntax. I guess the distinction was made to

Re: Lisp/Clojure doesn't have syntax?

2008-12-12 Thread Paul Barry
On Dec 11, 6:19 pm, Rich Hickey richhic...@gmail.com wrote: Yes, the critical point is that the text-based representation of code is completely secondary: (def x (list (list (symbol fn) (vector) Hello World))) (class (second (first x))) - clojure.lang.PersistentVector (class (first

Re: Lisp/Clojure doesn't have syntax?

2008-12-12 Thread Joost
Paul Barry schreef: Ok, so it's fair to say the Clojure Reader has syntax. I don't see how this is fundamentally different than how Ruby works, for example: http://www.igvita.com/2008/12/11/ruby-ast-for-fun-and-profit/ The clojure.lang.LispReader parses an input stream of text into a Java

Re: Lisp/Clojure doesn't have syntax?

2008-12-12 Thread Rich Hickey
On Dec 12, 4:13 pm, Joost jo...@zeekat.nl wrote: Paul Barry schreef: Ok, so it's fair to say the Clojure Reader has syntax. I don't see how this is fundamentally different than how Ruby works, for example: http://www.igvita.com/2008/12/11/ruby-ast-for-fun-and-profit/ The

Lisp/Clojure doesn't have syntax?

2008-12-11 Thread Paul Barry
I've been reading the latest chapter from Stuart's book, Chapter 7: Macros, and he makes this statement: Clojure has no special syntax for code. Code is simply Clojure data. This is true for normal functions, but also for special forms and macros. Consider a language with syntax, such as Java.

Re: Lisp/Clojure doesn't have syntax?

2008-12-11 Thread Randall R Schulz
On Thursday 11 December 2008 13:37, Paul Barry wrote: I've been reading the latest chapter from Stuart's book, Chapter 7: Macros, and he makes this statement: Clojure has no special syntax for code. Code is simply Clojure data. This is true for normal functions, but also for special forms

Re: Lisp/Clojure doesn't have syntax?

2008-12-11 Thread Sean Spencer
That was one of the best explanations of code as data I've ever read. Kudos! On Thu, Dec 11, 2008 at 4:44 PM, Randall R Schulz rsch...@sonic.net wrote: On Thursday 11 December 2008 13:37, Paul Barry wrote: I've been reading the latest chapter from Stuart's book, Chapter 7: Macros, and he

Re: Lisp/Clojure doesn't have syntax?

2008-12-11 Thread Paul Barry
On Dec 11, 4:44 pm, Randall R Schulz rsch...@sonic.net wrote: All these things are syntactic sugar. Shorthand ways to write things that have vanilla S-Expression counterparts. Again, I would not call them syntax. syntactic sugar is not syntax?

Re: Lisp/Clojure doesn't have syntax?

2008-12-11 Thread Dave Newton
--- On Thu, 12/11/08, Paul Barry wrote: syntactic sugar is not syntax? I think that depends on which particular nits are being picked. Is it strictly true that Clojure has no syntax? Meh--probably not. (defun foo [bar] ...) has more unique characters than (defun foo (bar) ...) or (define

Re: Lisp/Clojure doesn't have syntax?

2008-12-11 Thread Dave Griffith
My view is that Lisps have very a simple syntax, achieved at the cost of moving a fair amount of error checking until runtime. If you ignore reader macros, you can tell if a Clojure expression is well- formed by just keeping a count of open parentheses, which is about the least amount of state

Re: Lisp/Clojure doesn't have syntax?

2008-12-11 Thread Mon Key
Clojure does not allow for programmer-defined reader macros (unlike other lisps). I know this has been touched upon last Spring - and Stu Halloway refs at least one discussion of this in his book. From a practical standpoint I am beginning to understand more why the choice was made to not

Re: Lisp/Clojure doesn't have syntax?

2008-12-11 Thread Mon Key
Clojure does not allow for programmer-defined reader macros (unlike other lisps). I know this has been touched upon last Spring - and Stu Halloway refs at least one discussion of this in his book. From a practical standpoint I am beginning to understand more why the choice was made to not