Julia: Find better names for traits TypeOrder, TypeArithmetic and TypeRangeStep

Created on 7 Jan 2018  路  2Comments  路  Source: JuliaLang/julia

As discussed at https://github.com/JuliaLang/julia/pull/25402#issuecomment-355628275 and https://github.com/JuliaLang/julia/issues/20402#issuecomment-354769392, we should find better names for traits defined in traits.jl, since they are the only ones whose names start with Type. Here's a list with suggestions:

  • TypeOrder (possible choices: HasOrder/Unordered) -> OrderStyle (Ordered/Unordered), HasOrder (Ordered/Unordered) or IsOrdered (Ordered/Unordered)
  • TypeArithmetic (ArithmeticRounds/ArithmeticOverflows/ArithmeticUnknown) -> ArithmeticStyle or ArithmeticAccuracy (BTW, it would make sense to add ArithmeticExact and divide overflow into ArithmeticWrapsAround/ArithmeticSaturates.)
  • TypeRangeStep (RangeStepRegular/RangeStepIrregular) -> RangeStep or RangeStepStyle

Most helpful comment

I like using the Style suffix consistently:

  • OrderStyle: Ordered, Unordered and in the future possibly PartiallyOrdered.
  • ArithmeticStyle: ArithmeticRounds, ArithmeticWraps (I assume that's what ArithmeticOverflows means), ArithmeticUnknown, and future possibly ArithmeticSaturates.
  • RangeStepStyle: RangeStepRegular, RangeStepIrregular.

All 2 comments

I like using the Style suffix consistently:

  • OrderStyle: Ordered, Unordered and in the future possibly PartiallyOrdered.
  • ArithmeticStyle: ArithmeticRounds, ArithmeticWraps (I assume that's what ArithmeticOverflows means), ArithmeticUnknown, and future possibly ArithmeticSaturates.
  • RangeStepStyle: RangeStepRegular, RangeStepIrregular.

Triage likes the -Style suffix names. Not all traits need to end in style, but it seems like a good pattern.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

StefanKarpinski picture StefanKarpinski  路  3Comments

sbromberger picture sbromberger  路  3Comments

TotalVerb picture TotalVerb  路  3Comments

i-apellaniz picture i-apellaniz  路  3Comments

omus picture omus  路  3Comments