-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[docs] Add "currency type" to the lexicon #40874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a difference here!
The compiler understands Builtin
types like Builtin.NativeObject
, and it understands much higher-level common user types like String
. The types in the standard library are not considered builtins - they're built atop builtins more often than not. The document linked here describes optimization opportunities exposed by annotations and structures attached these higher-level types and associated operations.
"Currency" (often also "vocabulary") types are types that one reaches for in most common usages of the language. Do you want to manipulate a string - pick String
, not UnsafeMutableBufferPointer<CChar>
. Do you want a pack of unique elements - pick Set<T>
!
Then could the documentation clarify what "currency" means or provide a hyperlink? I didn't see it in |
also relevant answer on the forums: https://forums.swift.org/t/what-does-currency-type-mean/41065/2 |
Then let’s add it to the lexicon and link it!
…Sent from my iPhone
On Jan 17, 2022, at 3:35 AM, 冀卓疌 ***@***.***> wrote:
also relevant answer on the forums: https://forums.swift.org/t/what-does-currency-type-mean/41065/2
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.
|
The definition for currency still needs to be refined, could anyone help me here? |
Co-authored-by: Robert Widmann <[email protected]>
Co-authored-by: Robert Widmann <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
⛵
Note to self: manually squash this @swift-ci smoke test |
Co-authored-by: Xiaodi Wu <[email protected]>
@CodaFi you may need to retest this because of a one-character change. |
@swift-ci smoke test |
I don't understand why it says "currency", which means money. There might be some Swift data type for money, but I haven't heard of it yet. Also, the explanation misses that the entire document just covers built-in Swift types. Did you mean "concurrency"?