Anonymous user
Singly-linked list/Element insertion: Difference between revisions
Singly-linked list/Element insertion (view source)
Revision as of 22:02, 17 August 2008
, 15 years agoadd 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}}==
|