[swift-users] Lazy expression is ambiguous?

Quinn "The Eskimo!" eskimo1 at apple.com
Mon Sep 12 02:53:29 CDT 2016


On 12 Sep 2016, at 08:46, Rick Mann <rmann at latencyzero.com> wrote:

> I had assumed lazy worked like static, which I understand uses dispatch_once under the hood.

Correct.

[I’m not sure if it actually /uses/ `dispatch_once` specifically, but it has the same semantics.]

> Would that be a reasonable thing for lazy to do?

It certainly would be nice.  I suspect that this would be hard to implement because the restrictions associated with `dispatch_once` are pretty tight.  OTOH, if you’d like to see it work this way it wouldn’t hurt to file an enhancement request.

Share and Enjoy
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware




More information about the swift-users mailing list