Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!munnari.oz.au!bruce!goanna!ok From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) Newsgroups: comp.lang.scheme Subject: (case key (() ...) ...) interpretation. Message-ID: <5538@goanna.cs.rmit.oz.au> Date: 3 May 91 08:02:41 GMT Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 29 I haven't seen the final version of the Scheme standard, only Draft 4. D4 says of "case" that Each shall have the form (( ...) ...) where each is an external representation of some object. The impression that I get from this is that (() expr expr...) is a legal case clause, whose body will never be evaluated, because it contains no . However, several Scheme implementations do the CL thing of allowing the selector to be a non-list. (For example, the TI PC Scheme manual says that the selector is "a non-pair, or a list of non-pairs (not evaluated), including the optional keyword _else_". I have come across another Scheme with the same extension, where a selector of () is interpreted as if it were (()), so that (() expr expr...) will be selected if the key evaluates to (). This came up when writing a macro to generate 'case' forms, where it was rather convenient to take D4 literally. The existing variation in Scheme systems means that I have to rewrite the macro anyway, but what _should_ (() expr expr...) do as a case clause? -- Bad things happen periodically, and they're going to happen to somebody. Why not you? -- John Allen Paulos.