1-- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
2-- All rights reserved.
3--
4-- Redistribution and use in source and binary forms, with or without
5-- modification, are permitted provided that the following conditions are
6-- met:
7--
8--     - Redistributions of source code must retain the above copyright
9--       notice, this list of conditions and the following disclaimer.
10--
11--     - Redistributions in binary form must reproduce the above copyright
12--       notice, this list of conditions and the following disclaimer in
13--       the documentation and/or other materials provided with the
14--       distribution.
15--
16--     - Neither the name of The Numerical ALgorithms Group Ltd. nor the
17--       names of its contributors may be used to endorse or promote products
18--       derived from this software without specific prior written permission.
19--
20-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21-- IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22-- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
23-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
24-- OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25-- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26-- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
32)package "BOOT"
33
34-- some functions that may need to be changed on different lisp
35-- systems.
36
37-- tests if x is an identifier beginning with #
38
39isSharpVar x ==
40  IDENTP x and SCHAR(SYMBOL_-NAME x,0) = char "#"
41
42isSharpVarWithNum x ==
43  null isSharpVar x => nil
44  (n := QCSIZE(p := PNAME x)) < 2 => nil
45  ok := true
46  c := 0
47  for i in 1..(n-1) while ok repeat
48    d := ELT(p,i)
49    ok := DIGITP d => c := 10*c + DIG2FIX d
50  if ok then c else nil
51
52rread(key, rstream) ==
53  if IDENTP key then key := PNAME key
54  rread0(key, rstream)
55
56rread_list(key, rstream) ==
57    if IDENTP key then key := PNAME key
58    rread1(key, rstream, [])
59
60rwrite(key,val,stream) ==
61  if IDENTP key then key := PNAME key
62  rwrite0(key,val,stream)
63
64
65editFile file ==
66  MEMQ(INTERN('"WIN32",FIND_-PACKAGE("KEYWORD")),_*FEATURES_*) =>
67    OBEY STRCONC('"notepad ", namestring pathname file)
68  OBEY STRCONC('"$FRICAS/lib/SPADEDIT ",namestring pathname file)
69