[swift-evolution] [Discussion] Cleaning up stdlib pointer and buffer routines (Open Issues Affecting Standard Library API Stability)
Jordan Rose
jordan_rose at apple.com
Thu Jul 7 11:32:09 CDT 2016
> On Jul 7, 2016, at 08:58, Dmitri Gribenko <gribozavr at gmail.com> wrote:
>
> On Wed, Jul 6, 2016 at 9:57 PM, Charlie Monroe via swift-evolution
> <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>>
>> On Jul 7, 2016, at 12:46 AM, Jordan Rose via swift-evolution
>> <swift-evolution at swift.org> wrote:
>>
>>
>> On Jul 6, 2016, at 11:03, Jacob Bandes-Storch via swift-evolution
>> <swift-evolution at swift.org> wrote:
>>
>>
>>> * Remove unsafeAddressOf. "We are not aware of any real use cases for it.
>>> If there are any, it should be renamed to unsafeAddress(of:) to follow the
>>> guidelines." (https://bugs.swift.org/browse/SR-1957 rdar://problem/18589289)
>>>
>>
>> Oops, I just responded to this on another thread. Pasting:
>>
>> It's minor, but I use unsafeAddressOf regularly for writing `description`
>> methods:
>>
>> var description: String {
>> return "<\(self.dynamicType): \(unsafeAddressOf(self))>{ more info
>> here... }"
>> }
>>
>> I guess this would be covered by some generalized solution for format
>> specifiers in string interpolations, but I gather that won't happen for
>> quite a while...
>>
>>
>> I believe `ObjectIdentifier(self)` prints basically the same way.
>>
>> Jordan
>>
>>
>> Unfortunately, it doesn't:
>>
>> print("\(ObjectIdentifier(obj))")
>>
>> --> ObjectIdentifier(_value: (Opaque Value))
>
> We should absolutely fix that (does not even require a swift-evolution
> proposal). This string that it converts to is completely useless.
Filed a starter bug, https://bugs.swift.org/browse/SR-2014.
Jordan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160707/ca0090a0/attachment.html>
More information about the swift-evolution
mailing list