restructure + lecutre 07

This commit is contained in:
SowinskiBraeden committed 2026-02-19 11:59:58 -08:00
1 parent b8c19aa341
commit 7c3198fee4
96 files changed
+458 -4

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
(* display content of file read via stdin *)
let rec cat () =
try
let line = read_line () in
print_endline line;
cat()
with
| _ -> ();; (* EOF return unit *)
(* similar to main function *)
let () =
let rec aux () =
try
print_endline @@ read_line ();
aux ()
with
| _ -> ()
in
aux()
(* cat() *)
(**** build and test ****)
(*
ocamlbuild cat.native
./cat.native < filename
*)