[swift-evolution] Pitch: Improved Swift pointers

Goffredo Marocchi panajev at gmail.com
Tue Jul 18 15:42:39 CDT 2017


Mmh, I think like the do while -> repeat while change it makes sense, but not enough to displace the obvious meaning of the original... but then again, I lost back then...

Sent from my iPhone

Begin forwarded message:

> From: Andrew Trick via swift-evolution <swift-evolution at swift.org>
> Date: 18 July 2017 at 21:33:31 BST
> To: Taylor Swift <kelvin13ma at gmail.com>
> Cc: swift-evolution <swift-evolution at swift.org>
> Subject: Re: [swift-evolution] Pitch: Improved Swift pointers
> Reply-To: Andrew Trick <atrick at apple.com>
> 
> 
>>> On Jul 18, 2017, at 11:36 AM, Taylor Swift <kelvin13ma at gmail.com> wrote:
>>> 
>>> > fix the ordering of the arguments in initializeMemory<Element>(as:at:count:to:)
>>> 
>>> I think this ordering was an attempt to avoid confusion with binding
>>> memory where `to` refers to a type. However, it should be consistent
>>> with `UnsafePointer.initialize`, so we need to pick one of those to
>>> change.
>> 
>> This would be a non-issue had we just been consistent with the rest of the stdlib and named this argument `repeating:` instead of `to:`. But `ptr.initialize(repeating: 255, count: 100)` doesn’t read quite as naturally in English as `ptr.initialize(to: 255, count: 100)` which is why I left this idea out of the proposal. Now that you mention the problem with `initializeMemory<Element>(as:at:count:to:)`, it might be a good idea to add this rename back into it.
> 
> I think `repeating` is much more clear.
> 
> -Andy
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170718/1b65304d/attachment.html>


More information about the swift-evolution mailing list