Singly-linked list/Element insertion: Difference between revisions

add ocaml
m (→‎{{header|Ada}}: syntax highlighting)
(add ocaml)
Line 279:
end
end.
 
=={{header|OCaml}}==
This kind of list manipulation is unidiomatic OCaml. But you can try the following:
<ocaml>let rec insert_after a b = function
c :: cs when a = c -> a :: b :: cs
| c :: cs -> c :: insert_after a b cs
| [] -> raise Not_found</ocaml>
 
=={{header|Perl}}==
Anonymous user