swiftlang / swift-book

The Swift Programming Language book
Apache License 2.0
1.76k stars 162 forks source link

Make spelling of "canceled" match stdlib #270

Closed mattmassicotte closed 9 months ago

mattmassicotte commented 9 months ago

I have a feeling this may be contentious. However, I noticed that the concurrency section using the spelling "canceled" but the Swift standard library uses "cancelled". I'm not entirely sure which is right, but it seems like the book should match, don't you think?

amartini51 commented 9 months ago

This is a known incompatibility between style guides. Apple Style Guide, which this book follows, calls for the spelling "canceled":

Use one l for the verb cancel—for example canceled, canceling. Use two l’s for the noun cancellation.

https://support.apple.com/guide/applestyleguide/c-apsgb744e4a3/1.0/web/1.0

For historical reasons dating back to NeXTSTEP (in the 1980s), APIs in Foundation use the spelling "cancelled" — and I assume the standard library is following that spelling, for consistency between APIs.

mattmassicotte commented 9 months ago

Ah ha - thank you for explaining that! It certainly did seem intentional, so I should have known.