mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-12-08 20:38:47 +00:00
Adds basic support for the Swift programming language
Text only lexer for now until Pygments catches up
This commit is contained in:
13
samples/Swift/section-41.swift
Normal file
13
samples/Swift/section-41.swift
Normal file
@@ -0,0 +1,13 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user