Quasiquoting (final exam) Here is a more complex example, with C ASTs. This is an Ocaml function which builds ASTs that represent "calling a function on every value of an N-entry array" let iterate n arr fn = <:cstmt< for (i = 0; i < $int:n$; i++) { $ident:fn$($expr:arr$[i]); } >> The pre-processor expands this to: let iterate n arr fn = FOR (BINARY (ASSIGN, VARIABLE "i", CONSTANT (CONST_INT "0")), BINARY (LT, VARIABLE "i", CONSTANT (CONST_INT (string_of_int n))), UNARY (POSINCR, VARIABLE "i"), COMPUTATION (CALL (VARIABLE fn, [INDEX (arr, VARIABLE "i")])))