[swift-evolution] [Review] SE-0077 v2: Improved operator declarations
panajev at gmail.com
Sun Jul 3 03:13:18 CDT 2016
I think higherThan and lowerThan are not excessively wordy, they are the correct mathematical term, and the IDE can help you autocomplete that else it is a quick snippet job.
Sent from my iPhone
> On 2 Jul 2016, at 22:52, Nevin Brackett-Rozinsky via swift-evolution <swift-evolution at swift.org> wrote:
> On painting the relative-precedence bikeshed, I would lean slightly toward “before” and “after”. They are short, single words with unambiguous meaning.
> Moreover, the actual point of interest is “Which operators will be evaluated before which other ones?”
> Plus the word “precedence” itself connotes the idea of one thing preceding another, which is exactly what “before” and “after” convey.
> It is true that we often talk about things having “higher” precedence, but in context that becomes “higherThan”, which is lengthy.
> Now “above” / “below” would work just fine, though to me at least it isn’t as immediately-self-evident which is which for operators, as it would be with “before” / “after”.
> Another option would be “aheadOf” / “behind”, which seem clear in meaning but mismatched in word-count.
> Actually, I think “precedes” / “follows” might be worth considering. The former would be more common and it exactly matches not only the semantic but the exact terminology we want. Maybe “follows” isn’t maximally ideal, but at least it doesn’t have a synonym problem like “succeeds” does.
> Even there though, an ambiguity exists between “the group being defined precedes the listed one” and “the listed group precedes the one being defined”.
> So I would still tend toward prepositional descriptors, especially “before” and “after”.
>> On Friday, July 1, 2016, Anton Zhilin via swift-evolution <swift-evolution at swift.org> wrote:
>> John McCall via swift-evolution <swift-evolution at ...> writes:
>> > > There is a high chance that 'higherThan'/'lowerThan' names will be
>> > > chosen. I still see a problem with that. Keywords in Swift are
>> > > in full lowercase, so we should actually take
>> > >
>> > > But then what's the point of the preposition? It blends with
>> > > higher/lower and doesn't actually add any clarity. So we should drop
>> > > 'than' and have just higher/lower or above/below or
>> succeeds/preceeds or
>> > > whatever we choose, but *in a single word*.
>> > The preposition does add clarity. Are the listed precedences the ones
>> that are
>> > higher than the current precedence, or are they the ones that the
>> > precedence is higher than?
>> > John.
>> I meant that following keywords should be preferred to be written in all
>> lowercase. But in our case, we lose clarity from doing so.
>> An elegant solution seems to be to find expressive single-word keywords
>> for our purpose, their advantage is that they can strictly follow
>> keyword naming rules without losing clarity.
>> It seems that mine and some other people' concerns are based on this
>> naming inconsistency of higherThan and lowerThan. There are plenty of
>> other good options: above/below, before/after, precedes/succeeds.
>> I know your opinion, but anyways want this argument to be risen during
>> internal discussion.
>> swift-evolution mailing list
>> swift-evolution at swift.org
> swift-evolution mailing list
> swift-evolution at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution