Path: utzoo!attcan!uunet!munnari.oz.au!goanna!ok From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) Newsgroups: comp.lang.lisp Subject: Re: Virtues(?) of Lisp syntax Keywords: syntax words, functions, redundancy, cognitive engineering Message-ID: <3785@goanna.cs.rmit.oz.au> Date: 18 Sep 90 12:43:53 GMT References: <3368@skye.ed.ac.uk> <1350030@otter.hpl.hp.com> <3408@skye.ed.ac.uk> <3465@syma.sussex.ac.uk> Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 52 In article <3465@syma.sussex.ac.uk>, aarons@syma.sussex.ac.uk (Aaron Sloman) writes: > Prolog has yet another kind of syntactic poverty, inherited from its > dependence on a logical interpretation. (E.g. textual order has very > different procedural meanings depending on context: within a rule > concatenation means something like "and then", whereas between rules > with the same predicate it means something like "and if that fails > then try...") Not to defend Prolog syntax overmuch, but I had to stop and think for several minutes before I understood what Aaron Sloman was getting at here. It had never occurred to me that p :- % p a, % a b. % b. and p(a). % either p(a) p(b). % or-else p(b) were both "concatenation". For sequencing of clauses, yes it is plain juxtaposition. But and-then is an explicit operator ",", not mere concatenation. I have always experienced these two constructions as utterly different, and it is very hard for me to see them as similar. If we wrote (((p) ; p if (a) ; a and-then (b))) ; b and (((p a)) ; either p(a) ((p b))) ; or-else p(b) _then_ we would be using juxtaposition of lists for both. > For the record, I should also say that I don't think there's much > difference in readability between the following: > a(b(c(d, e), f(g, h))) [Pop-11 and Pascal, etc] > (a (b (c d e) (f g h))) [Lisp] I was about to agree, and then I suddenly realised that I find the second distinctly easier to read. Hang on a minute, I'm a _Prolog_ programmer, what's going on here? Just for fun, here's a Pop-2 statement that does the same function calls: d, e.c, g, h.f.b.a; Not to knock Pop. If Scheme is the Messiah, Pop is John the Baptist. [It's a _joke_, Joyce.] -- Heuer's Law: Any feature is a bug unless it can be turned off.