Skip to main content

Questions tagged [swift]

For questions about Swift's design, or languages which are closely related to Swift

Filter by
Sorted by
Tagged with
15 votes
5 answers
2k views

When can widening conversions cause problems?

I can understand the reason for raising a warning or error when you try to convert a wider integer type to a narrower one, due to the loss of precision. Some C compilers will warn about this: ...
CPlus's user avatar
  • 9,143
4 votes
1 answer
112 views

How could a language support adding new types to the middle of the inheritance tree in an ABI-stable way?

I've mentioned before that Swift evolution is somewhat limited by the fact that it is now ABI-stable. One recent example that caught my attention was PermutableCollection. Currently, the Collection ...
Bbrk24's user avatar
  • 9,407
1 vote
1 answer
268 views

How to avoid hidden performance problems in functional interfaces?

Swift has a protocol Sequence<Element>, which is used to support for-in loops. It has ...
Bbrk24's user avatar
  • 9,407
7 votes
2 answers
788 views

Why color literals?

One of the stranger features of Swift is color literals -- invocations of the #colorLiteral macro that look like colored squares in Xcode. In this image, the macro ...
Bbrk24's user avatar
  • 9,407