[swift-evolution] [Review] SE-0077 v2: Improved operator declarations
Nevin Brackett-Rozinsky
nevin.brackettrozinsky at gmail.com
Sat Jul 2 16:52:23 CDT 2016
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”.
Nevin
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
> written
> > > in full lowercase, so we should actually take
> 'higherthan'/'lowerthan'.
> > >
> > > 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
> current
> > 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 <javascript:;>
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160702/9f710e7e/attachment.html>
More information about the swift-evolution
mailing list