Article View: comp.lang.prolog
Article #2810Re: Thanks for the sour persimmons cousins, list syntax
From: Chris Moss
Date: Wed, 07 Oct 1987 18:18
Date: Wed, 07 Oct 1987 18:18
27 lines
1922 bytes
1922 bytes
In article <2278@mulga.oz> lee@mulga.UUCP (Lee Naish) writes: > H.T is more readable > H.T says the functor is '.' and there are two arguments, H and T > H.T is one less character ... >[H|T] confuses people. It has confused Prolog implementors! There are >Prolog implementations in which lists are not normal terms, due to this. >Of course it is a shame that '.' and ',' are so overloaded in Prolog, >but since '.' IS the list constructor functor, we may as well get it >out in the open for all to see. I have a lot of sympathy with this, and used to write all my conses with a dot. But now I think it shouldn't be allowed. After all, nobody likes writing full lists as a.b.c.d.[]. They always switch to [a,b,c,d] in the end. So it's more confusing having the two notations. Sure every IMPLEMENTOR must know that '.' is the cons functor. But it helps to clean up error handling if . on its own (i.e. not in a number or graphic symbol) is always the line terminator. Then one can get away from the silly errors like a(b).a(c). being treated as one clause. Most of the other arguments (one less character etc.) are far less important than the learning argument. Of course the best notation would be [a b c . X] (have I seen that before?) but then . as a terminator would be impossible. Chris Moss..
Technical Details
Message-ID:
<113@gould.doc.ic.ac.uk>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!uunet!mcvax!ukc!eagle!icdoc!cdsmReferences:
<5265@jade.BERKELEY.EDU> <2278@mulga.oz>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!mcvax!ukc!eagle!icdoc!cdsm From: cdsm@doc.ic.ac.uk (Chris Moss) Newsgroups: comp.lang.prolog Subject: Re: Thanks for the sour persimmons cousins, list syntax Message-ID: <113@gould.doc.ic.ac.uk> Date: Wed, 7-Oct-87 14:18:09 EDT Article-I.D.: gould.113 Posted: Wed Oct 7 14:18:09 1987 Date-Received: Mon, 12-Oct-87 22:31:28 EDT References: <5265@jade.BERKELEY.EDU> <2278@mulga.oz> Reply-To: cdsm@gould.UUCP (Chris Moss) Organization: Dept. of Computing, Imperial College, London, UK. Lines: 27