Why is the same text repeated

This looks curious and like a mistake (screen shot below):

I was curious about what .! operator was found above page which looks like this:

I can't quite grasp what repeating this text so many times implies (and there is more below that for another variant), and if there is something different it I think it ought to be visible:
"static func .! (SIMDMask) -> SIMDMask
A vector mask that is the pointwise logical negation of the input."

Also, I wish the documentation were written in a simpler tone than it is. I struggle with it, and mostly look elsewhere for help because it seems to introduce more complexity in examples than what one starts with. I would think that the audience for the documentation would include those learning, yet it seems slanted to the best of the best.

4 Likes

The repeating nature is DocC providing concrete output for every provided variation of the generic over <Storage> that it has an implementation for, although that's not currently reflected well in the summaries. If you go to each of those pages, you'll see what the variation is.

For example SIMDMask | Apple Developer Documentation'.!(_:)-1i6z4 reports Available when Storage is SIMD64<Int8>.

while SIMDMask | Apple Developer Documentation'.!(_:)-1uoo5 reports: Available when Storage is SIMD8<Int16>.

I'd encourage you to create an issue with Swift-DocC describing what you'd expect as the kind of output (repeating, or not - and how you'd expect to see it) in the case of iterating over concrete implementations for generic types.

For the content suggestion, I'd encourage you to file a feedback on the docs, providing the above URL, although if you have a better way to describe it, I'd also encourage you to open a pull request to update that documentation. The contents for that particular output are derived(1) from doc comments at swift/stdlib/public/core/SIMDVector.swift at 3718a15ec787f522f618cb508f583f3ef3a4a3cb · swiftlang/swift · GitHub

(1) that's not 100% accurate, as there's overlay documentation that is written by Apple that can override the content from source files, and I suspect might be the case in this situation. I did a search for that description string, and it's also included in swift/stdlib/public/core/SIMDConcreteOperations.swift.gyb at 3718a15ec787f522f618cb508f583f3ef3a4a3cb · swiftlang/swift · GitHub, (gyb is used to code-gen repeating patterns for concrete implementations).

4 Likes