Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!rice!titan.rice.edu!dorai From: dorai@titan.rice.edu (Dorai Sitaram) Newsgroups: comp.lang.scheme Subject: Re: On the standard behavior of "load" Message-ID: <7490@brazos.Rice.edu> Date: 8 May 90 16:47:19 GMT References: <3601@jato.Jpl.Nasa.Gov> Sender: root@rice.edu Organization: Rice University, Houston Lines: 24 In article <3601@jato.Jpl.Nasa.Gov> brian@granite.Jpl.Nasa.Gov (Brian of ASTD-CP) writes: >I would like to start a discussion concer- >ning the Scheme essential procedure "load". The >Scheme definition, R3.99RRS, states that the re- >turn value of "load" is unspecified. However, I >[...] >With many implementations of Scheme, load returns >#f when the file passed to it is not found, and #t >otherwise. I think this ought to be the standard >behavior of load. [...] Wouldn't you be satisfied with just `file-exists?'? Almost every Scheme I've come across provides this procedure -- though RRRS doesn't include it. Obviously, `file-exists?' and the unspecified-returning `load' provide the capability you desire (load-module, etc.). (define load1 (lambda (f) (if (file-exists? f) (begin (load f) #t) #f))) (NB: The #f/#t `load' doesn't make `file-exists?' superfluous. The latter provides the ability to say that a file exists without having to load it too.) --dorai