Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!mintaka!ai-lab!zurich.ai.mit.edu!jaffer From: jaffer@zurich.ai.mit.edu (Aubrey Jaffer) Newsgroups: comp.lang.scheme Subject: Re: standards Message-ID: Date: 31 May 91 19:24:08 GMT References: <1991May30.013756.21021@cs.umn.edu> Sender: news@ai.mit.edu Organization: M.I.T. Artificial Intelligence Lab. Lines: 33 In-reply-to: carlton@husc8.harvard.edu's message of 31 May 91 15:36:50 GMT >I have a different but related problem: I want to be able to write >programs which will run portably under lots of different Scheme >implementations, in particular under both R3RS and R4RS >implementations. This is (basically) impossible to do currently if >you want to use functions such as number->string, which take different >arguments under the two standards. What I am currently doing is >providing a dialect-specific initialization file, which then defines >some symbols telling what version of the standard is adhered to, etc., >and also defines some other functions that are dialect-specific, such >as the error functions; and then loads another file which takes care >of (say) all of the R3RS defines. For example, my T dialect file >looks like ... GOOD IDEA! In my symbolic math system I have files for R4RS, IEEE, scm2d, and common_lisp which all emulate the same functions. But your idea would give me finer control over features. I also strongly suggest that we define: CHAR-CODE-LIMIT CHAR-CODE-LOWER-LIMIT MOST-POSITIVE-FIXNUM MOST-NEGATIVE-FIXNUM The CHAR-CODE-LIMITs are needed for programs such as parsers that need to dispatch on character codes. The Scheme specs do not specify that char->integer returns non-negative integers so we also need CHAR-CODE-LOWER-LIMIT. The FIXNUM variables are useful for programs which use monte-carlo or modular methods. These algorigthms are effecient only when the random numbers used are large but do not require consing. My benchmark attempt (digits of pi) would also have had fewer mysteries if these limits had been available.