type 'a mylist = 'a listcell ref
and 'a listcell = Nil | Cons of 'a * ('a mylist)
let l1 = (ref (Cons (1, ref (Cons (2,ref Nil)))))
let l2 = (ref (Cons(3, ref (Cons(4, ref Nil)))))
let rec append l1 l2 =
match l1 with
| {contents = Nil} -> (l1 := !l2; l1)
| {contents = Cons(h,t)} -> append t l2
diese anfügen, was ich bisher bekommen habe, ist das Ziel l2 anhänge l1 i bis zum Ende des l1 durchqueren kann und den Referee mit l2 ersetzen ... welche ist was ich versucht habe zu tun. aber aus irgendeinem Grund verliere ich alles, was vorher kam.wie zwei veränderbare Listen in ocaml
jede mögliche Hilfe würde geschätzt, dank