/[mojave]/metaprl/library/nuprl5.ml
ViewVC logotype

Diff of /metaprl/library/nuprl5.ml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2041 by lolorigo, Tue Jul 29 16:45:38 1997 UTC revision 2099 by eli, Fri Mar 20 22:16:22 1998 UTC
# Line 9  Line 9 
9    
10  let make_bool_parameter b =  let make_bool_parameter b =
11    make_param (ParmList    make_param (ParmList
12                  [(make_param (Token "bool")); (make_param (Number (if b then 1 else 0)))])                  [(make_param (Token "bool")); (make_param (Number (Num.Int (if b then 1 else 0))))])
13  let make_time_parameter time =  let make_time_parameter time =
14    let (a, b) = dest_bigint time in    let (a, b) = dest_bigint time in
15    make_param (ParmList    make_param (ParmList
16                  [(make_param (Token "time")); (make_param (Number a)); (make_param (Number b))])                  [(make_param (Token "time")); (make_param (Number (Num.Int a))); (make_param (Number (Num.Int b)))])
17    
18  let time_parameter_p p =  let time_parameter_p p =
19    match (dest_param p) with    match (dest_param p) with
# Line 30  Line 30 
30    match (dest_param p) with    match (dest_param p) with
31      ParmList [h; v] -> (match (dest_param h) with      ParmList [h; v] -> (match (dest_param h) with
32        Token s -> if s = "bool" then (match (dest_param v) with        Token s -> if s = "bool" then (match (dest_param v) with
33          Number i -> (i = 1) or (i = 0)          Number (Num.Int i) -> (i = 1) or (i = 0)
34        | _ -> false) else false        | _ -> false) else false
35      | _ -> false)      | _ -> false)
36    | _ -> false    | _ -> false
# Line 39  Line 39 
39    match (dest_param p) with    match (dest_param p) with
40      ParmList [h; a; b] -> (match (dest_param h) with      ParmList [h; a; b] -> (match (dest_param h) with
41        Token s -> if s = "time" then (match (dest_param a) with        Token s -> if s = "time" then (match (dest_param a) with
42          Number i -> (match (dest_param b) with          Number (Num.Int i) -> (match (dest_param b) with
43            Number k -> make_bigint (i, k)            Number (Num.Int k) -> make_bigint (i, k)
44          | _ -> raise (Invalid_argument "destruct_time_parameter"))          | _ -> raise (Invalid_argument "destruct_time_parameter"))
45        | _ -> raise (Invalid_argument "destruct_time_parameter"))        | _ -> raise (Invalid_argument "destruct_time_parameter"))
46        else raise (Invalid_argument "destruct_time_parameter")        else raise (Invalid_argument "destruct_time_parameter")
# Line 51  Line 51 
51    match (dest_param p) with    match (dest_param p) with
52      ParmList [h; v] -> (match (dest_param h) with      ParmList [h; v] -> (match (dest_param h) with
53        Token s -> if s = "bool" then (match (dest_param v) with        Token s -> if s = "bool" then (match (dest_param v) with
54          Number i -> i = 1          Number (Num.Int i) -> i = 1
55        | _ -> raise (Invalid_argument "destruct_bool_parameter"))        | _ -> raise (Invalid_argument "destruct_bool_parameter"))
56        else raise (Invalid_argument "destruct_bool_parameter")        else raise (Invalid_argument "destruct_bool_parameter")
57      | _ -> raise (Invalid_argument "destruct_bool_parameter"))      | _ -> raise (Invalid_argument "destruct_bool_parameter"))

Legend:
Removed from v.2041  
changed lines
  Added in v.2099

  ViewVC Help
Powered by ViewVC 1.1.26