Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
17 lines (15 sloc) 387 Bytes
open Printf
1;;
#part 1
printf "%i is an integer, %F is a float, \"%s\" is a string\n"
3 4.5 "five";;
#part 2
printf "An integer: %i\n" 4.5;;
#part 3
let fmt = "%i is an integer, %F is a float, \"%s\" is a string\n";;
printf fmt 3 4.5 "five";;
#part 4
let fmt : ('a, 'b, 'c) format =
"%i is an integer, %F is a float, \"%s\" is a string\n";;
#part 5
printf fmt 3 4.5 "five";;