Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!zephyr.ens.tek.com!tekcrl!tekchips!kend From: kend@tekchips.LABS.TEK.COM (Ken Dickey) Newsgroups: comp.lang.scheme Subject: Re: () as an expression Message-ID: <5413@tekcrl.LABS.TEK.COM> Date: 16 Jan 90 20:55:13 GMT References: <1990Jan16.193134.10491@sun.soe.clarkson.edu> Sender: ftp@tekcrl.LABS.TEK.COM Reply-To: kend@mrloog.WR.TEK.COM (Ken Dickey) Organization: Tektronix, Inc., Beaverton, OR. Lines: 24 In article <1990Jan16.193134.10491@sun.soe.clarkson.edu> jk0@sun.soe.clarkson.edu (Jason Coughlin) writes: >The Revised^3 Report says that () is an illegal expression. It must >be quoted. However, MIT-Scheme and PC-Scheme both allow it, ie: ... >Why is () an invalid expression? It seems to me that it is a constant. > >(eq? #t #t) => #t >(eq? #f #f) => #t >(eq? '() '()) => #t > >now why isn't () considered a constant, when it really IS a constant? The syntax () is considered a combination (a.k.a. procedure call) and as such must have at lease one subexpression. So, the empty list is valid, but the empty combination is an error. Note also that #f and '() may be distinct in newer Scheme implementations [the value of (eq? '() #f) is currently unspecified]. There are other non-R^3RS behaviors allowed by various versions of Scheme implementations, particularly those implementations done before R^3RS was issued. -Ken Dickey