3 ms·
<bikeshed> It feels off to call things like Array part of any library when you have array literal syntax `let oddNumbers = [1, 3, 5, 7, 9, 11, 13, 15]` I'd cal
by avisser 4y ago
<bikeshed>
It feels off to call things like Array part of any library when you have array literal syntax `let oddNumbers = [1, 3, 5, 7, 9, 11, 13, 15]`
I'd call that a language feature. Or maybe with Swift there is a blurry line between the two?
- saagarjha 4y agoArrays are part of the Swift standard library. Foundation is another library that provides access to things like I/O, networking, calendars, etc.
- mayoff 4y agoArray is defined in the Swift standard library, but the compiler knows about the type directly, and also recognizes various @_semantics("array.blah") annotations that appear in the standard library source code. I believe the semantics annotations are primarily to help the optimizer. https://github.com/apple/swift/blob/main/stdlib/public/core/Array.swift https://github.com/apple/swift/blob/main/stdlib/public/core/...