[swift-evolution] [Review] SE-0088: Modernize libdispatch for Swift 3 naming conventions

Gwendal Roué gwendal.roue at gmail.com
Thu May 12 06:57:55 CDT 2016


Does the proposal fixes the errors introduced by the latest May 9 snapshot ?

Since IUO are abolished (https://github.com/apple/swift-evolution/blob/master/proposals/0054-abolish-iuo.md) and pointer nullability is expressed using Optional (https://github.com/apple/swift-evolution/blob/master/proposals/0055-optional-unsafe-pointers.md), I get many errors as soon as I use libdispatch:

	let sem = dispatch_semaphore_create(0)
	dispatch_semaphore_wait(sem, …)				// Error: Value of optional type not unwrapped
	dispatch_semaphore_signal(sem)					// Error: Value of optional type not unwrapped

	let source = dispatch_source_create(…)
	dispatch_source_set_event_handler(source) { … }	// Error: Value of optional type not unwrapped
	dispatch_source_set_cancel_handler(source) { … }	// Error: Value of optional type not unwrapped
	dispatch_resume(source)						// Error: Value of optional type not unwrapped

Of course, it's easy to fix. Still, the fix is usually adding a bang (!), because most apps prefer crashing when dispatch_semaphore_create or dispatch_source_create fails. And if I don't mind using bangs when it's the best solution, I can't be happy to see bangs everywhere.

In short: libdispatch is currently in its worst state ever :-)

Cheers to all,
Gwendal Roué

> Le 11 mai 2016 à 06:39, Chris Lattner via swift-evolution <swift-evolution at swift.org> a écrit :
> Hello Swift community,
> The review of "SE-0088: Modernize libdispatch for Swift 3 naming conventions" begins now and runs through May 17. The proposal is available here:
> 	https://github.com/apple/swift-evolution/blob/master/proposals/0088-libdispatch-for-swift3.md
> Reviews are an important part of the Swift evolution process. All reviews should be sent to the swift-evolution mailing list at
> 	https://lists.swift.org/mailman/listinfo/swift-evolution
> or, if you would like to keep your feedback private, directly to the review manager.
> What goes into a review?
> The goal of the review process is to improve the proposal under review through constructive criticism and contribute to the direction of Swift. When writing your review, here are some questions you might want to answer in your review:
> 	* What is your evaluation of the proposal?
> 	* Is the problem being addressed significant enough to warrant a change to Swift?
> 	* Does this proposal fit well with the feel and direction of Swift?
> 	* If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
> 	* How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
> More information about the Swift evolution process is available at
> 	https://github.com/apple/swift-evolution/blob/master/process.md
> Thank you,
> -Chris Lattner
> Review Manager
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

More information about the swift-evolution mailing list