Lines Matching refs:tab
127 fun dest tab = fold_rev_table cons tab [];
128 fun keys tab = fold_rev_table (cons o #1) tab [];
180 fun lookup tab key =
197 in look tab end;
199 fun lookup_key tab key =
216 in look tab end;
218 fun defined tab key =
235 in def tab end;
246 fun modify key f tab =
284 (case modfy tab of
285 Stay tab' => tab'
287 handle SAME => tab
290 fun update (key, x) tab = modify key (fn _ => x) tab;
291 fun update_new (key, x) tab = modify key (fn NONE => x | SOME _ => raise DUP key) tab;
292 fun default (key, x) tab = modify key (fn NONE => x | SOME _ => raise SAME) tab;
380 fun delete key tab = snd (snd (del (SOME key) tab));
381 fun delete_safe key tab = if defined tab key then delete key tab else tab;
388 fun member eq tab (key, x) =
389 case lookup tab key of NONE => false | SOME y => eq x y
396 fun remove eq (key, x) tab =
397 case lookup tab key of
398 NONE => tab
399 | SOME y => if eq x y then delete key tab else tab
408 fun add (key, y) tab =
409 modify key (fn NONE => y | SOME x => f key (x, y)) tab;
421 fun lookup_list tab key = these (lookup tab key);
423 fun cons_list (key, x) tab = modify key (fn NONE => [x] | SOME xs => x :: xs) tab;
429 fun remove_list eq (key, x) tab =
430 map_entry key (fn xs => (case op_remove eq x xs of [] => raise UNDEF key | ys => ys)) tab
431 handle UNDEF _ => delete key tab;
438 fun dest_list tab =
439 List.concat (map (fn (key, xs) => map (pair key) xs) (dest tab))
452 fun pp vpp tab =
461 (pr_list ppi [add_string ",", add_break(1,0)] (dest tab)),