Artifact 5a2d0b39d4ad8e54466fb23b73c287f7a3bdc71d8434fdf62a48c536644f4dd2:
- File
psl-1983/3-1/util/pathin.sl
— part of check-in
[eb17ceb7f6]
at
2020-04-21 19:40:01
on branch master
— Add Reduce 3.0 to the historical section of the archive, and some more
files relating to version sof PSL from the early 1980s. Thanks are due to
Paul McJones and Nelson Beebe for these, as well as to all the original
authors.git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/historical@5328 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 1535) [annotate] [blame] [check-ins using] [more...]
- File
psl-1983/util/pathin.sl
— part of check-in
[eb17ceb7f6]
at
2020-04-21 19:40:01
on branch master
— Add Reduce 3.0 to the historical section of the archive, and some more
files relating to version sof PSL from the early 1980s. Thanks are due to
Paul McJones and Nelson Beebe for these, as well as to all the original
authors.git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/historical@5328 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 1535) [annotate] [blame] [check-ins using]
% % PATHIN.SL - Rlisp IN function with a search path % % Author: Eric Benson % Symbolic Computation Group % Computer Science Dept. % University of Utah % Date: 26 July 1982 % Copyright (c) 1982 University of Utah % % PATHIN(filename-tail:string):none EXPR % % PATHIN allows the use of a directory search path with the Rlisp IN function. % The fluid variable PATHIN* should be a list of strings, which are directory % names. These will be successively concatenated onto the front of the % string argument to PATHIN until an existing file is found. If one is found, % IN will be invoked on the file. If not, a continuable error occurs. % E.g, if PATHIN* is ("" "/usr/src/cmd/psl/" "/u/smith/"), (pathin "foo.red") % will attempt to open "foo.red", then "/usr/src/cmd/psl/foo.red", and finally % "/u/smith/foo.red". (bothtimes (fluid '(pathin*))) (compiletime (flag '(pathin-aux) 'internalfunction)) (loadtime (flag '(pathin) 'ignore)) % just like IN, gets done while compiling (loadtime (if (null pathin*) (setq pathin* '("")))) % acts like IN until path is changed (de pathin (filename-tail) (pathin-aux filename-tail pathin*)) (de pathin-aux (filename-tail search-path-list) (if (null search-path-list) (conterror 99 "File not found in path" (pathin filename-tail)) (let ((test-file (concat (first search-path-list) filename-tail))) (if (filep test-file) (evin (list test-file)) (pathin-aux filename-tail (rest search-path-list))))))