Files
linguist/samples/Swift/section-41.swift
Andy Lindeman 8f251e6756 Adds basic support for the Swift programming language
Text only lexer for now until Pygments catches up
2014-06-02 15:54:05 -04:00

14 lines
308 B
Swift

func hasAnyMatches(list: Int[], condition: Int -> Bool) -> Bool {
for item in list {
if condition(item) {
return true
}
}
return false
}
func lessThanTen(number: Int) -> Bool {
return number < 10
}
var numbers = [20, 19, 7, 12]
hasAnyMatches(numbers, lessThanTen)