[swift-evolution] [Draft] Conventionalize #setline
antonyzhilin at gmail.com
Sun Mar 6 09:26:55 CST 2016
We currently have following main conventions for #-directives:
1. Directive without arguments:
2. Directive with pseudo-parameters:
#colorliteral(red: _, green: _, blue: _, alpha: _)
#if comes with a condition argument:
`#if condition` and not `#if(condition)`
But the idea behind such a "twist" is to use existing experience from
normal `if` statements.
#setline 10 "main.swift"
I propose that we only leave 1 and 2 syntax, and 3 is discussable. It means
that any directive must either have no arguments, or be called using
For now, that means that we need to change #setline syntax to the following:
#setline(10, file: "main.swift")
It becomes objectively more readable and more consistent. And all future
directives must comply to forms 1 or 2 unless they have a strong reason not
This proposal is tightly connected to my idea for operators:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution