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:
11
samples/Swift/section-87.swift
Normal file
11
samples/Swift/section-87.swift
Normal file
@@ -0,0 +1,11 @@
|
||||
func anyCommonElements <T, U where T: Sequence, U: Sequence, T.GeneratorType.Element: Equatable, T.GeneratorType.Element == U.GeneratorType.Element> (lhs: T, rhs: U) -> Bool {
|
||||
for lhsItem in lhs {
|
||||
for rhsItem in rhs {
|
||||
if lhsItem == rhsItem {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
anyCommonElements([1, 2, 3], [3])
|
||||
Reference in New Issue
Block a user