package devkit
Development kit - general purpose library
Install
Dune Dependency
Authors
Maintainers
Sources
devkit-1.20210517.tbz
md5=00995ebead339d6ec1ba7859c3fc3a58
sha256=5ad39c7fa1a966a2f0a7f6dbb7e82c787439c73482f5f44b3c9fb54b040d36eb
sha512=8dd3f7d4aaabae9aa9ede13edee2b22214c0d2e2780bb08b2ca8ed588d74fc6d9b1908bb31dfee49c949c7cc425fb98897b8e0f11280070ebd99b965908ea133
doc/src/devkit.core/control.ml.html
Source file control.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
let bracket resource destroy k = Std.finally (fun () -> destroy resource) k resource let wrapped acc result k = let r = ref None in let () = Std.finally (fun () -> r := Some (result acc)) k acc in match !r with | None -> assert false | Some x -> x let with_open_in_txt name = bracket (open_in name) close_in_noerr let with_open_out_txt name = bracket (open_out name) close_out_noerr let with_open_in_bin name = bracket (open_in_bin name) close_in_noerr let with_open_out_bin name = bracket (open_out_bin name) close_out_noerr let with_open_out_temp_file ?temp_dir ~mode = bracket (Filename.open_temp_file ~mode ?temp_dir "dvkt" "tmp") (fun (_,ch) -> close_out_noerr ch) let with_open_out_temp_bin k = with_open_out_temp_file ~mode:[Open_binary] k let with_open_out_temp_txt k = with_open_out_temp_file ~mode:[Open_text] k let wrapped_output io = wrapped io IO.close_out let wrapped_outs k = wrapped_output (IO.output_string ()) k let with_input io = bracket io IO.close_in let with_input_bin name k = with_open_in_bin name (fun ch -> k (IO.input_channel ch)) let with_input_txt name k = with_open_in_txt name (fun ch -> k (IO.input_channel ch)) let with_output io = bracket io IO.close_out let with_output_bin name k = with_open_out_bin name (fun ch -> bracket (IO.output_channel ch) IO.flush k) let with_output_txt name k = with_open_out_txt name (fun ch -> bracket (IO.output_channel ch) IO.flush k) let with_opendir dir = bracket (Unix.opendir dir) Unix.closedir
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>