String interpolation (included): Difference between revisions

→‎{{header|OCaml}}: Add string interpolation ppx example
(→‎{{header|OCaml}}: Add string interpolation ppx example)
Line 1,356:
<lang ocaml>let extra = "little" in
Printf.printf "Mary had a %s lamb." extra</lang>
 
Another option is to use compiler plugin mechanism and ''ppx_string_interpolation'':
 
<lang ocaml>
let name = "world" in
[%string "Hello $name!"]
</lang>
 
=={{header|OOC}}==
Anonymous user