Something went wrong. Try again.
a scheme notebook; emacs meets obsidian; probably never finished
Something went wrong. Try again.
1234567891011121314151617181920212223242526type t = { id: Id.t; read: unit -> char option;}
let of_string name string = let id = Id.from_string name in let length = String.length string in let offset = ref 0 in let read () = if (!offset == length) then None else let c = String.unsafe_get string !offset in incr offset; Some c in { id; read; }
let of_channel name chan = let id = Id.from_string name in let read () = try Some (input_char chan) with End_of_file -> None in { id; read; }