Browse code
Cleanup, make build with modern cmucl
fiddlerwoaroof authored on 02/02/2017 19:50:57
Showing 34 changed files
Showing 34 changed files
- ast/cmu
- backend/cmu
- bin/cmu
- bin/cmu-haskell
- cfn/cmu
- cl-support/cl-init.lisp
- cl-support/cl-support/cmu
- cl-support/cmu
- com/cmu/compile
- com/cmu/savesys
- command-interface/cmu
- csys/cmu
- depend/cmu
- derived/cmu
- doc/cmu
- emacs-tools/cmu
- flic/cmu
- haskell-setup
- import-export/cmu
- init.sh
- parser/cmu
- prec/cmu
- printers/cmu
- progs/cmu
- progs/prelude/PreludeArray.hs
- progs/prelude/PreludeCore.hs
- progs/prelude/PreludeRatio.hs
- progs/prelude/cmu
- runtime/cmu
- support/cmu
- tdecl/cmu
- top/cmu
- type/cmu
- util/cmu
... | ... |
@@ -7,6 +7,7 @@ |
7 | 7 |
;;; files. |
8 | 8 |
|
9 | 9 |
(eval-when (:load-toplevel :compile-toplevel :execute) |
10 |
+ (ext:unlock-all-packages) |
|
10 | 11 |
(unless (find-package "MUMBLE-IMPLEMENTATION") |
11 | 12 |
(make-package "MUMBLE-IMPLEMENTATION" :use '("LISP")))) |
12 | 13 |
|
... | ... |
@@ -21,7 +22,7 @@ |
21 | 22 |
|
22 | 23 |
|
23 | 24 |
;;; CMU CL prints too many compiler progress messages. |
24 |
-#+cmu |
|
25 |
+#+(and null cmu) |
|
25 | 26 |
(progn |
26 | 27 |
(setq *compile-print* '()) |
27 | 28 |
(setq *load-verbose* t) |
... | ... |
@@ -1,27 +1,27 @@ |
1 |
-#!/bin/csh |
|
1 |
+#!/usr/bin/zsh |
|
2 | 2 |
# |
3 | 3 |
# Set up for Yale Haskell 2.x users. |
4 | 4 |
# |
5 | 5 |
|
6 |
-setenv PRELUDE $HASKELL/progs/prelude |
|
7 |
-setenv HASKELL_LIBRARY $HASKELL/progs/lib |
|
6 |
+export PRELUDE=$HASKELL/progs/prelude |
|
7 |
+export HASKELL_LIBRARY=$HASKELL/progs/lib |
|
8 | 8 |
|
9 | 9 |
# You may need to change this to point at the appropriate subdirectory, |
10 | 10 |
# depending on which Lisp is being used. |
11 |
-#setenv PRELUDEBIN $PRELUDE/lucid |
|
12 |
-setenv PRELUDEBIN $PRELUDE/cmu |
|
11 |
+#export PRELUDEBIN=$PRELUDE/lucid |
|
12 |
+export PRELUDEBIN=$PRELUDE/cmu |
|
13 | 13 |
|
14 | 14 |
# You may need to change this to point at the appropriate subdirectory, |
15 | 15 |
# depending on which Lisp is being used. |
16 |
-#setenv LIBRARYBIN $HASKELL_LIBRARY/bin/lucid |
|
17 |
-setenv LIBRARYBIN $HASKELL_LIBRARY/bin/cmu |
|
16 |
+#setenv LIBRARYBIN=$HASKELL_LIBRARY/bin/lucid |
|
17 |
+export LIBRARYBIN=$HASKELL_LIBRARY/bin/cmu |
|
18 | 18 |
|
19 | 19 |
# You may need to change this to point at the appropriate executable, |
20 | 20 |
# depending on which Lisp is being used. |
21 |
-#setenv HASKELLPROG $HASKELL/bin/haskell |
|
22 |
-setenv HASKELLPROG $HASKELL/bin/cmu-haskell |
|
21 |
+#export HASKELLPROG $HASKELL/bin/haskell |
|
22 |
+export HASKELLPROG=$HASKELL/bin/cmu-haskell |
|
23 | 23 |
|
24 | 24 |
# You only need this next definition if you are using the CMU CL version |
25 | 25 |
# of haskell and you have /tmp mounted on a tmpfs file system (it won't |
26 | 26 |
# be able to initialize itself otherwise). |
27 |
-#setenv CMUCL_EMPTYFILE /var/tmp/empty |
|
27 |
+#export CMUCL_EMPTYFILE=/var/tmp/empty |
1 | 3 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,9 @@ |
1 |
+export HASKELL="$PWD" |
|
2 |
+export Y2="$HASKELL" |
|
3 |
+export PRELUDE="$HASKELL/progs/prelude" |
|
4 |
+export HASKELL_LIBRARY="$HASKELL/progs/lib" |
|
5 |
+export LIBRARYBIN="$HASKELL_LIBRARY/bin/cmu" |
|
6 |
+export HASKELLPROG="$HASKELL/bin/cmu-haskell" |
|
7 |
+export CMUCL="`which cmucl`" |
|
8 |
+export CMUCLBIN="$CMUCL" |
|
9 |
+export CMUCLLIB="/usr/lib/cmucl/" |
... | ... |
@@ -185,12 +185,13 @@ instance (Ix a, Eq b) => Eq (Array a b) where |
185 | 185 |
instance (Ix a, Ord b) => Ord (Array a b) where |
186 | 186 |
a <= a' = assocs a <= assocs a' |
187 | 187 |
|
188 |
-instance (Ix a, Text a, Text b) => Text (Array a b) where |
|
188 |
+instance (Ix a, Show a, Show b) => Show (Array a b) where |
|
189 | 189 |
showsPrec p a = showParen (p > 9) ( |
190 | 190 |
showString "array " . |
191 | 191 |
shows (bounds a) . showChar ' ' . |
192 | 192 |
shows (assocs a) ) |
193 | 193 |
|
194 |
+instance (Ix a, Read a, Read b) => Read (Array a b) where |
|
194 | 195 |
readsPrec p = readParen (p > 9) |
195 | 196 |
(\r -> [(array b as, u) | ("array",s) <- lex r, |
196 | 197 |
(b,t) <- reads s, |
... | ... |
@@ -198,12 +198,9 @@ defaultEnumFromThenTo n n' m |
198 | 198 |
type ReadS a = String -> [(a,String)] |
199 | 199 |
type ShowS = String -> String |
200 | 200 |
|
201 |
-class Text a where |
|
201 |
+class Read a where |
|
202 | 202 |
readsPrec :: Int -> ReadS a |
203 |
- showsPrec :: Int -> a -> ShowS |
|
204 | 203 |
readList :: ReadS [a] |
205 |
- showList :: [a] -> ShowS |
|
206 |
- |
|
207 | 204 |
readList = readParen False (\r -> [pr | ("[",s) <- lex r, |
208 | 205 |
pr <- readl s]) |
209 | 206 |
where readl s = [([],t) | ("]",t) <- lex s] ++ |
... | ... |
@@ -213,6 +210,11 @@ class Text a where |
213 | 210 |
[(x:xs,v) | (",",t) <- lex s, |
214 | 211 |
(x,u) <- reads t, |
215 | 212 |
(xs,v) <- readl' u] |
213 |
+ |
|
214 |
+class Show a where |
|
215 |
+ showsPrec :: Int -> a -> ShowS |
|
216 |
+ showList :: [a] -> ShowS |
|
217 |
+ |
|
216 | 218 |
showList [] = showString "[]" |
217 | 219 |
showList (x:xs) |
218 | 220 |
= showChar '[' . shows x . showl xs |
... | ... |
@@ -232,17 +234,20 @@ class Binary a where |
232 | 234 |
|
233 | 235 |
-- data () = () deriving (Eq, Ord, Ix, Enum, Binary) |
234 | 236 |
|
235 |
-instance Text () where |
|
237 |
+instance Read () where |
|
236 | 238 |
readsPrec p = readParen False |
237 | 239 |
(\r -> [((),t) | ("(",s) <- lex r, |
238 | 240 |
(")",t) <- lex s ] ) |
241 |
+instance Show () where |
|
239 | 242 |
showsPrec p () = showString "()" |
240 | 243 |
|
241 | 244 |
|
242 | 245 |
-- Binary type |
243 | 246 |
|
244 |
-instance Text Bin where |
|
247 |
+instance Read Bin where |
|
245 | 248 |
readsPrec p s = error "readsPrec{PreludeText}: Cannot read Bin." |
249 |
+ |
|
250 |
+instance Show Bin where |
|
246 | 251 |
showsPrec p b = showString "<<Bin>>" |
247 | 252 |
|
248 | 253 |
|
... | ... |
@@ -288,14 +293,11 @@ charEnumFromThen c c' = map chr [ord c, ord c' .. ord lastChar] |
288 | 293 |
{-# charEnumFrom :: Inline #-} |
289 | 294 |
{-# charEnumFromThen :: Inline #-} |
290 | 295 |
|
291 |
-instance Text Char where |
|
296 |
+instance Read Char where |
|
292 | 297 |
readsPrec p = readParen False |
293 | 298 |
(\r -> [(c,t) | ('\'':s,t)<- lex r, |
294 | 299 |
(c,_) <- readLitChar s]) |
295 | 300 |
|
296 |
- showsPrec p '\'' = showString "'\\''" |
|
297 |
- showsPrec p c = showChar '\'' . showLitChar c . showChar '\'' |
|
298 |
- |
|
299 | 301 |
readList = readParen False (\r -> [(l,t) | ('"':s, t) <- lex r, |
300 | 302 |
(l,_) <- readl s ]) |
301 | 303 |
where readl ('"':s) = [("",s)] |
... | ... |
@@ -303,6 +305,10 @@ instance Text Char where |
303 | 305 |
readl s = [(c:cs,u) | (c ,t) <- readLitChar s, |
304 | 306 |
(cs,u) <- readl t ] |
305 | 307 |
|
308 |
+instance Show Char where |
|
309 |
+ showsPrec p '\'' = showString "'\\''" |
|
310 |
+ showsPrec p c = showChar '\'' . showLitChar c . showChar '\'' |
|
311 |
+ |
|
306 | 312 |
showList cs = showChar '"' . showl cs |
307 | 313 |
where showl "" = showChar '"' |
308 | 314 |
showl ('"':cs) = showString "\\\"" . showl cs |
... | ... |
@@ -418,12 +424,14 @@ numericEnumFromThen n m = iterate (+(m-n)) n |
418 | 424 |
{-# numericEnumFromThen :: Inline #-} |
419 | 425 |
|
420 | 426 |
|
421 |
-instance Text Int where |
|
427 |
+instance Read Int where |
|
422 | 428 |
readsPrec p = readSigned readDec |
429 |
+instance Show Int where |
|
423 | 430 |
showsPrec = showSigned showInt |
424 | 431 |
|
425 |
-instance Text Integer where |
|
432 |
+instance Read Integer where |
|
426 | 433 |
readsPrec p = readSigned readDec |
434 |
+instance Show Integer where |
|
427 | 435 |
showsPrec = showSigned showInt |
428 | 436 |
|
429 | 437 |
|
... | ... |
@@ -584,12 +592,14 @@ instance Enum Double where |
584 | 592 |
{-# enumFromTo :: Inline #-} |
585 | 593 |
{-# enumFromThenTo :: Inline #-} |
586 | 594 |
|
587 |
-instance Text Float where |
|
595 |
+instance Read Float where |
|
588 | 596 |
readsPrec p = readSigned readFloat |
597 |
+instance Show Float where |
|
589 | 598 |
showsPrec = showSigned showFloat |
590 | 599 |
|
591 |
-instance Text Double where |
|
600 |
+instance Read Double where |
|
592 | 601 |
readsPrec p = readSigned readFloat |
602 |
+instance Show Double where |
|
593 | 603 |
showsPrec = showSigned showFloat |
594 | 604 |
|
595 | 605 |
|
... | ... |
@@ -597,8 +607,9 @@ instance Text Double where |
597 | 607 |
|
598 | 608 |
-- data [a] = [] | a : [a] deriving (Eq, Ord, Binary) |
599 | 609 |
|
600 |
-instance (Text a) => Text [a] where |
|
610 |
+instance (Read a) => Read [a] where |
|
601 | 611 |
readsPrec p = readList |
612 |
+instance (Show a) => Show [a] where |
|
602 | 613 |
showsPrec p = showList |
603 | 614 |
|
604 | 615 |
|
... | ... |
@@ -621,8 +632,9 @@ instance (Text a, Text b) => Text (a,b) where |
621 | 632 |
|
622 | 633 |
-- Functions |
623 | 634 |
|
624 |
-instance Text (a -> b) where |
|
635 |
+instance Read (a -> b) where |
|
625 | 636 |
readsPrec p s = error "readsPrec{PreludeCore}: Cannot read functions." |
637 |
+instance Show (a -> b) where |
|
626 | 638 |
showsPrec p f = showString "<<function>>" |
627 | 639 |
|
628 | 640 |
-- Support for class Bin |
... | ... |
@@ -774,7 +786,7 @@ instance (Text a1, Text a2, Text a3) => Text (a1,a2,a3) where |
774 | 786 |
instance (Eq a1, Eq a2, Eq a3, Eq a4) => Eq (a1,a2,a3,a4) where |
775 | 787 |
(a1,a2,a3,a4) == (z1,z2,z3,z4) = a1==z1 && a2==z2 && a3==z3 && a4 == z4 |
776 | 788 |
|
777 |
-instance (Text a1, Text a2, Text a3, Text a4) => Text (a1,a2,a3,a4) where |
|
789 |
+instance (Read a1, Read a2, Read a3, Read a4) => Read (a1,a2,a3,a4) where |
|
778 | 790 |
readsPrec p = readParen False |
779 | 791 |
(\r0 -> [((a1,a2,a3,a4), w) | |
780 | 792 |
("(",r1) <- lex r0, |
... | ... |
@@ -786,15 +798,20 @@ instance (Text a1, Text a2, Text a3, Text a4) => Text (a1,a2,a3,a4) where |
786 | 798 |
(",",r7) <- lex r6, |
787 | 799 |
(a4,r8) <- reads r7, |
788 | 800 |
(")",w) <- lex r8 ]) |
801 |
+ |
|
802 |
+instance (Show a1, Show a2, Show a3, Show a4) => Show (a1,a2,a3,a4) where |
|
789 | 803 |
showsPrec p (a1,a2,a3,a4) = |
790 | 804 |
showChar '(' . shows a1 . showChar ',' . |
791 | 805 |
shows a2 . showChar ',' . |
792 | 806 |
shows a3 . showChar ',' . |
793 | 807 |
shows a4 . showChar ')' |
794 | 808 |
|
795 |
-instance (Text a1, Text a2, Text a3, Text a4, Text a5) => |
|
796 |
- Text (a1,a2,a3,a4,a5) where |
|
809 |
+instance (Read a1, Read a2, Read a3, Read a4, Read a5) => |
|
810 |
+ Read (a1,a2,a3,a4,a5) where |
|
797 | 811 |
readsPrec p = error "Read of 5 tuples not implemented" |
812 |
+ |
|
813 |
+instance (Show a1, Show a2, Show a3, Show a4, Show a5) => |
|
814 |
+ Show (a1,a2,a3,a4,a5) where |
|
798 | 815 |
showsPrec p (a1,a2,a3,a4,a5) = |
799 | 816 |
showChar '(' . shows a1 . showChar ',' . |
800 | 817 |
shows a2 . showChar ',' . |
... | ... |
@@ -802,9 +819,12 @@ instance (Text a1, Text a2, Text a3, Text a4, Text a5) => |
802 | 819 |
shows a4 . showChar ',' . |
803 | 820 |
shows a5 . showChar ')' |
804 | 821 |
|
805 |
-instance (Text a1, Text a2, Text a3, Text a4, Text a5, Text a6) => |
|
806 |
- Text (a1,a2,a3,a4,a5,a6) where |
|
822 |
+instance (Read a1, Read a2, Read a3, Read a4, Read a5, Read a6) => |
|
823 |
+ Read (a1,a2,a3,a4,a5,a6) where |
|
807 | 824 |
readsPrec p = error "Read of 6 tuples not implemented" |
825 |
+ |
|
826 |
+instance (Show a1, Show a2, Show a3, Show a4, Show a5, Show a6) => |
|
827 |
+ Show (a1,a2,a3,a4,a5,a6) where |
|
808 | 828 |
showsPrec p (a1,a2,a3,a4,a5,a6) = |
809 | 829 |
showChar '(' . shows a1 . showChar ',' . |
810 | 830 |
shows a2 . showChar ',' . |
... | ... |
@@ -59,12 +59,13 @@ instance (Integral a) => Enum (Ratio a) where |
59 | 59 |
enumFrom = iterate ((+)1) |
60 | 60 |
enumFromThen n m = iterate ((+)(m-n)) n |
61 | 61 |
|
62 |
-instance (Integral a) => Text (Ratio a) where |
|
62 |
+instance (Integral a) => Read (Ratio a) where |
|
63 | 63 |
readsPrec p = readParen (p > prec) |
64 | 64 |
(\r -> [(x%y,u) | (x,s) <- reads r, |
65 | 65 |
("%",t) <- lex s, |
66 | 66 |
(y,u) <- reads t ]) |
67 | 67 |
|
68 |
+instance (Integral a) => Show (Ratio a) where |
|
68 | 69 |
showsPrec p (x:%y) = showParen (p > prec) |
69 | 70 |
(shows x . showString " % " . shows y) |
70 | 71 |
|