Newsgroups: comp.lang.scheme Path: utzoo!utgpu!news-server.csri.toronto.edu!torsqnt!geac!sq!dak From: dak@sq.sq.com (David A Keldsen) Subject: Re: Logic does not Apply Message-ID: <1991May2.180853.11028@sq.sq.com> Organization: SoftQuad Inc. References: <9104300906.aa04392@mc.lcs.mit.edu> Date: Thu, 2 May 91 18:08:53 GMT Lines: 33 Gordon Oulsnam (stcs8004@iruccvax.ucc.hea.ie) writes: [why aren't 'and' and 'or' strict in Scheme?] >It seems to me that the difference lies in the fact that the logical >operators are defined in the R3 and R3.99 reports (section 7.3) as being >*derived* expression types, so presumably do not qualify as 'procedures' in >the sense specified for the first argument to 'apply' (section 6.9). Correct, although I'd put it more simply: 'and' and 'or' are syntax, not procedures. All Scheme procedures are strict. 'and' and 'or' are not strict, which is how "short-circuiting" boolean evaluation is made available to you in Scheme. >That the logical operators are derived expressions may well be the *legal* >answer as to why 'and' and 'or' cannot be used with 'apply'---my question >is though: is it a *reasonable* answer, with or without the RxRs Reports to >hand? Why shouldn't 'and' and 'or' be first class citizens of Scheme? Because they are syntax, not procedures. You can only apply procedures. >It seems that logic does not apply! :-) As you point out, if you want the strict behavior, you can get it by the usual eta transformation; going the other way is much more difficult. In this sense, scheme is providing you with the "more fundamental" tools. Regards, Dak -- David A. 'Dak' Keldsen of SoftQuad, Inc. email: dak@sq.com phone: 416-963-8337 "I daresay you haven't had much practice," said the Queen. "When I was your age, I always did it for half-an-hour a day. Why, sometimes I've believed as many as six impossible things before breakfast." _Through the Looking Glass_