# Why assignment operators return the right-hand-side

**URL:** <https://discourse.julialang.org/t/why-assignment-operators-return-the-right-hand-side/109954>\
**Category:** Internals & Design\
**Created:** [February 7, 2024, 9:14pm UTC](https://discourse.julialang.org/t/why-assignment-operators-return-the-right-hand-side/109954 "2024-02-07T21:14:42Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![mnemnion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mnemnion/32/206596_2.png) [@mnemnion](https://discourse.julialang.org/u/mnemnion)\
**Post date:** [February 8, 2024, 3:44pm UTC](https://discourse.julialang.org/t/why-assignment-operators-return-the-right-hand-side/109954/11 "2024-02-08T15:44:44Z")

</div>

> [@Benny](#):
>
> Is there a language where chained assignment is _left_-associative? AFAIK it’s all right-associative, it’s just a tossup whether the value is the right hand side (which becomes the value assigned to every target) or the left hand side (which becomes a chain of possible changes via assignment and access).

No, I was just wrong about that. How would you assign a semantics to `b` in an expression like `(a = b) = c`? `b` is meaningless before `c` is evaluated.

One might want a _syntax_ like that in a language where the normal return value of assignment is the left side, but that wouldn’t make things truly left associative.

There’s a reason mathematicians dislike `=` for assignment, assignment has none of the properties of equality suggested by the symbol.

---

_[View the full topic](https://discourse.julialang.org/t/why-assignment-operators-return-the-right-hand-side/109954)._
