Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!mcgill-vision!snorkelwacker!usc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!uunet!mcsun!ukc!edcastle!aiai!jeff From: jeff@aiai.ed.ac.uk (Jeff Dalton) Newsgroups: comp.lang.lisp Subject: Re: Virtues of Lisp syntax Message-ID: <3408@skye.ed.ac.uk> Date: 12 Sep 90 19:32:14 GMT References: <3368@skye.ed.ac.uk> <1350030@otter.hpl.hp.com> Reply-To: jeff@aiai.UUCP (Jeff Dalton) Organization: AIAI, University of Edinburgh, Scotland Lines: 75 In article <1350030@otter.hpl.hp.com> sfk@otter.hpl.hp.com (Steve Knight) writes: >Andy (& Jeff too) point out that: >>Prolog most definitely has quoting rules; case matters in obscure ways >>and constants that begin with the wrong case have to be quoted. The result >>isn't simpler. > >OK - you can see the distinction between variables (begin with upper case) >and atoms (anything else) as a quoting scheme. However, it certainly has >none of the complexity of Lisp's quoting schemes -- there's nothing that >corresponds to backquoting. It hardly deserves the adjective 'obscure'. Backquote is, in my opinion, a separate issue. Let me put it this way: the rules for the use of QUOTE in Lisp (and for its abbreviation the single quote) are neither obscure nor difficult to understand. As I said in my previous message, the quoting rules for Lisp needn't be any more confusing that those of, say, Basic. As far as Prolog is concerned, the original claim was that Prolog didn't have quoting rules. I don't really want to quarrel about whether Prolog is better or worse than Lisp in this respect or in general. >As evidence to this, I've never seen a failure-to-quote error committed in >Prolog, though I've seen it many times in Lisp. Is this just a UK thing? >Perhaps teaching methods in the US mean that students rarely or never >make those errors? I know it is a big problem for Lisp acceptance for >students in the UK. In my experience, in both the US and the UK, it is true that students often make quoting mistakes in Lisp and that they often find the quoting rules confusing. I think there are a number of possible contributing factors. A common mistake in presentation, I think, is to make non-evaluation seem too much of a special case. For example, some people see SETQ as confusing because it evaluates one "argument" and not another and so they prefer to present SET first. This doesn't work so well in Scheme or even in Common Lisp, but it sort of worked for older Lisps. Unfortunately, it makes SETQ seem like a special case when it's actually a pretty standard assignment: Lisp Basic (setq a 'apples) let a$ = "apples" (setq b a) let b$ = a$ vs (setq b 'a) vs let b$ = "a$" Indeed, the whole terminology in which SETQ, COND, etc. are presented as funny kinds of "functions" and where functions are described as "evaluating an argument" (or not) may be a mistake. >Obviously, the attractiveness of syntax is in the eye of the beholder. >I have to accept that folks like Jeff are sincere when they argue that the >syntax of Lisp is very attractive for them. (I am even inclined to agree >when the alternative is C++.) I would agree, provided we don't take this "eye of the beholder" stuff too far. It's true that different people will prefer different syntaxes and that we can't say they're wrong to do so. However, we shouldn't go on to conclude that all views on the virtues or otherwise of a syntax are equally valid. Sometimes we can say, for example, that someone hasn't learned good techniques for reading and writing code in a particular syntax and that's why they find it so hard to read and write. >My argument, which wasn't contradicted, I think, was only that you could >have the same benefits of Lisp syntax without the exact same syntax. Actually, I did disagree with you on this point. Perhaps I should have said so more explicitly. I don't think you can get the same benefits. You can get *some* of the benefits, but by sacrificing some of the others. Lisp occupies something like a local maximum in "benefit space". -- Jeff