[swift-evolution] [Review] SE-0030 Property Behaviors

Trent Nadeau tanadeau at gmail.com
Thu Feb 11 15:40:25 CST 2016


>From what I've seen @ is used for annotations, which apply to declarations.
I've never seen them used as an attribute like foo. at bar.

foo.#behavior(lazy).clear() seems clearer than foo.[lazy].clear().

On Thu, Feb 11, 2016 at 4:36 PM, Brent Royal-Gordon <brent at architechies.com>
wrote:

> > Where [lazy] is currently used, could the syntax instead be
> #behavior(lazy)? That prevents a possible future naming clash, keeps the #
> meaning compiler-magic, and doesn't use the [], which is contentious.
>
> I think that if we go down this road, @behavior(lazy) or just @lazy is
> strictly superior. We already have the @ sigil for attributes; we don't
> need to introduce another sigil for no apparent reason.
>
> (But unless we're going to use the latter syntax and say "all @s are
> behaviors, we just haven't formalized func/type/etc. behaviors yet" so we
> finally have an idea of what @ means, I don't think either of these
> syntaxes is better than the one proposed.)
>
> --
> Brent Royal-Gordon
> Architechies
>
>


-- 
Trent Nadeau
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160211/9e1bffc4/attachment.html>


More information about the swift-evolution mailing list