Newsgroups: comp.lang.lisp
From: Pascal Bourguignon <p...@informatimago.com>
Date: Tue, 17 Oct 2006 13:24:12 +0200
Local: Tues, Oct 17 2006 7:24 am
Subject: Re: trouble learning LISP
Ken Tilton <kentil...@gmail.com> writes: If only we could whack thru the Internet... > [...] The > only help the OP needs is a whack from a stick to get them to let go > of their last language and remember they are supposed to be learning a > new one. > Instead the denizens of c.l.l (other than PB) are helping the Lisp has not syntax. Lisp has no parentheses. Lisp as no lists. > OP with syntax. Nah.... Well, it has, some, but not at the same level the other languages have Lisp has no syntax. Indeed, since the sources are but syntactic trees, there's no concrete But inside a program, There is no syntax, eg. for a complex number, no Lisp has no parentheses. Indeed, just try it: (map nil (function print) '(a b c)) A 0 parentheses in (a b c). In lisp _sources_, there are no parentheses. Of course, actually (set-syntax-from-char #\[ #\() Et hop! No parentheses anymore: [map nil [function print] '[a b c]] A Or we could write a macro or a parser, that would generate some code Lisp has no list. Again, just ask it: (type-of '(a b c)) --> CONS See? No type LIST here. Above the level of the CONS cells, we build an abstraction named LIST. But above this level of "lists", that are actually just cons cells, OPERATOR being the _label_ of the tree node, and The _sources_ of a lisp program are just syntactic trees, at a higher Of course, at this higher level, there is some 'syntax'. After all, label: + children: 1 2 3 You need to know the order of the children, what child to put at what We don't need, and it would be ridiculous from the point of view of block ::= '{' { statement ';' } '}' . or even, to specify some BEGIN and END tokens like in Pascal: block ::= 'BEGIN' [ statement { ';' statement } ] 'END' . (note the artificial difference in _syntax_! Blocks, both in Pascal label: BLOCK children: <statement>... and this is all that matters. Well, in lisp, we just put: label: BLOCK children: <statement>... in the source. For example, by way of the READER (and therefore, using the characters (map nil (function print) BLOCK But we could also build the syntactic tree node by way of an expression: (map nil (function print) BLOCK That's why things like ((expression1) (expression2)) are antithetic to -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||