[swift-evolution] Pitch: Improved Swift pointers

Brent Royal-Gordon brent at architechies.com
Wed Aug 9 20:22:08 CDT 2017


> On Jul 19, 2017, at 11:21 AM, Taylor Swift via swift-evolution <swift-evolution at swift.org> wrote:
> 
> What about `value:`?
> 
> `ptr.initialize(value: value)`
> `ptr.initialize(value: value, count: 13)`
> `ptr.initialize(as: UInt16.self, at: 0, value: value, count: 13)`

Doesn't read as a sentence. Consider how "initialize to 3" sounds different from "initialize value 3".

Personally, I'd go with:

	ptr.initialize(to: value)
	ptr.initialize(to: value, repeatCount: 3)

(Or just `repeat`/`repeating` if you don't feel like you need the word "count" to disambiguate.)

-- 
Brent Royal-Gordon
Architechies

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170809/31ead792/attachment.html>


More information about the swift-evolution mailing list