Swift code examples lifted from KNR 'C' textbook