1.1 --- a/src/Tools/isac/library.sml Tue Sep 28 08:58:06 2010 +0200
1.2 +++ b/src/Tools/isac/library.sml Tue Sep 28 09:06:56 2010 +0200
1.3 @@ -33,7 +33,7 @@
1.4 if n > 0 then drop (n - 1, xs) else x :: xs;
1.5
1.6 (*exn LIST has disappeared in 2009 ... replaced by error...*)
1.7 -fun last_elem [] = raise error "last_elem" (*FIXME.2009*)
1.8 +fun last_elem [] = error "last_elem" (*FIXME.2009*)
1.9 | last_elem [x] = x
1.10 | last_elem (_ :: xs) = last_elem xs;
1.11
1.12 @@ -100,7 +100,7 @@
1.13
1.14 fun cons2 (f,g) x = (f x, g x); (*PL softwareparadigmen*)
1.15
1.16 -fun nth _ [] = raise error "nth _ []"
1.17 +fun nth _ [] = error "nth _ []"
1.18 | nth 1 (x::_) = x
1.19 | nth n (_::xs) = nth (n-1) xs;
1.20 (*WN050106 quick for test: doesn't check for exns*)
1.21 @@ -268,15 +268,15 @@
1.22 fun intsto1 0 = []
1.23 | intsto1 n = (intsto1 (n-1)) @ [n]
1.24 in
1.25 -fun intsto n = if n < 0 then (raise error "intsto < 0") else intsto1 n
1.26 +fun intsto n = if n < 0 then (error "intsto < 0") else intsto1 n
1.27 end;
1.28
1.29
1.30 type 'a stack = 'a list;
1.31 fun top ((x::xs):'a stack) = x
1.32 - | top _ = raise error "top called for empty list";
1.33 + | top _ = error "top called for empty list";
1.34 fun pop ((x::xs):'a stack) = xs:'a stack
1.35 - | pop _ = raise error "pop called for empty list";
1.36 + | pop _ = error "pop called for empty list";
1.37 fun push x (xs:'a stack) = x::xs:'a stack;
1.38
1.39
1.40 @@ -295,7 +295,7 @@
1.41
1.42 (*.take elements from b to e including both.*)
1.43 fun take_fromto from to l =
1.44 - if from > to then raise error ("take_fromto from="^string_of_int from^
1.45 + if from > to then error ("take_fromto from="^string_of_int from^
1.46 " > to="^string_of_int to)
1.47 else drop (from - 1, take (to, l));
1.48 (*> take_fromto 3 5 [1,2,3,4,5,6,7];