# A != b != c

**URL:** <https://discourse.julialang.org/t/a-b-c/1347>\
**Category:** Internals & Design\
**Tags:** proposal\
**Created:** [January 7, 2017, 3:57pm UTC](https://discourse.julialang.org/t/a-b-c/1347 "2017-01-07T15:57:38Z")\
**Posts on this page:** 10\
**Page:** 2

<div class="post-metadata">

**Author:** ![pint](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pint/32/125_2.png) [@pint](https://discourse.julialang.org/u/pint)\
**Post date:** [January 10, 2017, 9:23am UTC](https://discourse.julialang.org/t/a-b-c/1347/21 "2017-01-10T09:23:46Z")

</div>

> [@ChrisRackauckas](#):
>
> A linked list chain where you define a\<b to mean a is immediately to the left of b? That sounds like a perfectly useful and valid dispatch for \< for which it wouldn’t be transitive.

not to me. \< has a very specific meaning, and it means “comes before” in some ordering. of course you are allowed to define anything, but to be useful, you need to define things in a way that makes sense to the reader. you need to build on preexisting knowledge and concepts. and we don’t need to support weird definitions either.

example. how julia knows that \* has precedence over +? what if i define \* and + for my type in a way that precedence should be the other way. but julia does not provide a way to define my own precedence. for + and \* are reserved for use cases that match this concept. so the compiler can simply assume how they behave, because otherwise you would not use these operators.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [January 10, 2017, 9:50am UTC](https://discourse.julialang.org/t/a-b-c/1347/22 "2017-01-10T09:50:04Z")

</div>

> [@pint](#):
>
> but to be useful, you need to define things in a way that makes sense to the reader

See this comment above:

> [@A != b != c](https://discourse.julialang.org/t/a-b-c/1347/15):
>
> I think you’re getting at the real problem with this kind of discussion: people don’t all have the same intuitions, so debating intuitions doesn’t generally lead to any improvements in language design.

---

<div class="post-metadata">

**Author:** ![pint](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pint/32/125_2.png) [@pint](https://discourse.julialang.org/u/pint)\
**Post date:** [January 10, 2017, 10:12am UTC](https://discourse.julialang.org/t/a-b-c/1347/23 "2017-01-10T10:12:42Z")

</div>

i think i have explained why i think this is not the case

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [January 10, 2017, 4:09pm UTC](https://discourse.julialang.org/t/a-b-c/1347/24 "2017-01-10T16:09:45Z")

</div>

> [@pint](#):
>
> i think i have explained why i think this is not the case

And I showed you a case where `<` was the obvious operator and wasn’t transitive. Our disagreement on how obvious this is proves @johnmyleswhite 's point.

---

<div class="post-metadata">

**Author:** ![pint](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pint/32/125_2.png) [@pint](https://discourse.julialang.org/u/pint)\
**Post date:** [January 10, 2017, 5:34pm UTC](https://discourse.julialang.org/t/a-b-c/1347/25 "2017-01-10T17:34:38Z")

</div>

> [@ChrisRackauckas](#):
>
> I showed you a case where \< was the obvious operator

and i replied that it is not only not obvious, it is objectively wrong.

---

<div class="post-metadata">

**Author:** ![johnmyleswhite](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnmyleswhite/32/31_2.png) [@johnmyleswhite](https://discourse.julialang.org/u/johnmyleswhite)\
**Post date:** [January 10, 2017, 6:37pm UTC](https://discourse.julialang.org/t/a-b-c/1347/26 "2017-01-10T18:37:06Z")

</div>

> and i replied that it is not only not obvious, it is objectively wrong.

Please, let’s stop this thread now. Once the word “objective” gets brought into a conversation, it’s time for the conversation to stop.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [January 10, 2017, 6:56pm UTC](https://discourse.julialang.org/t/a-b-c/1347/27 "2017-01-10T18:56:58Z")

</div>

It’s my bad for inciting that. I just couldn’t help myself. I think this thread should be closed: I am not sure anything useful can come out of where this has gone.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [January 10, 2017, 8:02pm UTC](https://discourse.julialang.org/t/a-b-c/1347/28 "2017-01-10T20:02:05Z")

</div>

> [@ChrisRackauckas](#):
>
> I am not sure anything useful can come out of where this has gone.

Perhaps some policy about discussions on surface syntax? They are started by well-meaning people, but seem to inevitably lead to discussions like this (I will not enumerate here the Github issues where this also happened). I am not saying that there could be no improvement to the Julia syntax, just that some minor barrier to entry could be useful. Eg “topic will be deleted unless there is a PR or a package implementing the suggestion, except for core developers”.

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [January 11, 2017, 4:26pm UTC](https://discourse.julialang.org/t/a-b-c/1347/29 "2017-01-11T16:26:17Z")

</div>

> [@Palli](#):
>
> is there a use case in which \< is not transitive?

You omitted the above that I was answering:

> [@johnmyleswhite](#):
>
> > It should be in all cases (as logic dictates), the expand you showed, only shows what the current implementations of Julia does.
> 
> You’re now actively spreading misinformation. Please stop.

[where you referring to the “expand”, as not clear you’re right then either?]

Am I missing something? I stated \< is transitive in “all cases”, as logic dictates:

> **[Transitive relation](https://en.wikipedia.org/wiki/Transitive_relation)**
>
> In mathematics, a relation R on a set X is transitive if, for all elements a, b, c in X, whenever R relates a to b and b to c, then R also relates a to c. Each partial order as well as each equivalence relation needs to be transitive.
> All definitions tacitly require the homogeneous relation 
>   
>     
>       
> R
>       
>     
> {\\displaystyle R}
>   
> be transitive: for all 
>   
>     
>       
> a
> ,
> b
> ,
> c
> ,
>       
>     
> {\\displaystyle a,b,c,}
>   
> i...

“whenever A \> B and B \> C, then also A \> C”

I didn’t say != is transitive. Are you assuming Julia must implement short-circuit, as “logical”?

Outdated sentence: When there are no side-effects, you do not have to evaluate in strict left-to-right [implied] short-circuit order. EDIT, turns out you do not have to (see quote from doc below).

Yes, if you can overload \< [I’m stating it’s illogical, to add a meaning for \< that is non-transitive] then you can’t. Julia can know if you did(?); if so, then overloading doesn’t make what I said untrue, strictly.

“However, the order of evaluations in a chained comparison is undefined. It is strongly recommended not to use expressions with side effects (such as printing) in chained comparisons. If side effects are required, the short-circuit && operator should be used explicitly”

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [January 11, 2017, 4:48pm UTC](https://discourse.julialang.org/t/a-b-c/1347/30 "2017-01-11T16:48:12Z")

</div>

Closed on January 11, 2017, 4:48pm UTC



[Previous page](https://discourse.julialang.org/t/a-b-c/1347.md?page=1)
