Re: Lisp/Clojure doesn't have syntax?

2008-12-12 Thread Joost
Rich Hickey schreef: > I'm not sure Clojure has more built-in reader constructs than Common > Lisp, which has reader syntax for vectors, arrays, pathnames, dotted > pairs, bitvectors, read-time evaluation, labels, label references, > read-time conditionals, many kinds of numbers, functions, balanc

Re: Lisp/Clojure doesn't have syntax?

2008-12-12 Thread Rich Hickey
On Dec 12, 4:13 pm, Joost 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 clojure.lang.Li

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

Re: Lisp/Clojure doesn't have syntax?

2008-12-12 Thread Paul Barry
On Dec 11, 6:19 pm, Rich Hickey 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 (first x)))

Re: Lisp/Clojure doesn't have syntax?

2008-12-12 Thread r
On Fri, Dec 12, 2008 at 1:38 PM, Mark Volkmann 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 stress that the Clojure's

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 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 all the >>

Re: Lisp/Clojure doesn't have syntax?

2008-12-12 Thread Rich Hickey
On Dec 12, 1:35 am, Mon Key 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 am beginning to

Re: Lisp/Clojure doesn't have syntax?

2008-12-12 Thread evins.mi...@gmail.com
On Dec 11, 3:58 pm, Randall R Schulz 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 2008 06

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 s

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 s

Re: Lisp/Clojure doesn't have syntax?

2008-12-11 Thread Randall R Schulz
On Thursday 11 December 2008 15:24, Dave Griffith wrote: > ... > On the downside, you can't tell until runtime whether a given function > call has an acceptable arity, which pretty much any other popular > language can check at edit-time. Given that function definitions are closed, it's eminentl

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 Rich Hickey
On Dec 11, 5:03 pm, Daniel Eklund 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 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 Randall R Schulz
On Thursday 11 December 2008 13:50, Paul Barry wrote: > On Dec 11, 4:44 pm, Randall R Schulz 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 Stuart Halloway
Randall, Well said, and I need to find a place to make this explanation in the book prior to chapter 7. :-) Stuart > 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: >> >> "Cloj

Re: Lisp/Clojure doesn't have syntax?

2008-12-11 Thread Daniel Eklund
> 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, su

Re: Lisp/Clojure doesn't have syntax?

2008-12-11 Thread Randall R Schulz
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 2008 06:32, evins.mi...@gmail.com wrote: > Subject: Re: In core stru

Re: Lisp/Clojure doesn't have syntax?

2008-12-11 Thread Paul Barry
On Dec 11, 4:44 pm, Randall R Schulz 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? --~--~-~--~~~---~--~~ You recei

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 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 makes this st

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 for

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