Ignore:
Timestamp:
Oct 7, 2010, 2:49:53 PM (9 years ago)
Author:
mulligan
Message:

Timers implemented (including demonic thirteen bit timer).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D4.1/BitVectors.ml

    r147 r162  
    3939let get_bit index l =
    4040  try
    41     Some (List.nth index l)
    42   with (Failure _ | Invalid_argument _) -> None
     41    List.nth index l
     42  with (Failure _ | Invalid_argument _) -> assert false
    4343
    4444let set_bit l index new_val =
     
    4949      | 0,_::tl -> new_val::tl
    5050      | n,hd::tl -> hd::(aux (n-1) tl) in
    51      Some (List.rev (aux index (List.rev l)))
    52   with Invalid_argument "" -> None
     51          List.rev (aux index (List.rev l))
     52  with Invalid_argument "" -> assert false
    5353
    5454let (-&-) l1 l2 = List.map2 (fun b1 b2 -> b1 & b2) l1 l2
Note: See TracChangeset for help on using the changeset viewer.