, :
frobnicate (function
| 0x01 -> gets , a_record_uuid
| 0x02 -> gets , a_group
...
)
, OCaml, 1 ° Objective Caml " ", fun a s -> a.a_record_uuid <- s a_record_uuid ( ) 2 ° , :
exists 'a. int -> (unit -> record * 'a) * ('a -> record -> unit)
, 1 °, , :
type complex = { re : int ; im : int }
let re r c = { c with re = r }
let im r c = { c with im = i }
, , , . , ( 20 ).
2 °, , :
let t e read write = let c, x = read () in write x e ; `More_record c
:
let t = t a in
match
| 0x01 -> t gets a_record_uuid
| 0x02 -> t gets a_title
...
, CamlP4 - . , , ( , ):
let t read reference = let c, x = read () in reference := x ; `More_record c
match
| 0x01 -> t gets a.a_record_uuid
...