Because of the paucity of available characters in ASCII, the character “=“ has been traditionally overload to mean:
Mutation
Equality
Synonym
Assignment of all fields of a source object to the corresponding fields of destination object (Odin programming language)
Named parameter, named argument
‘Synonym’ looks like mutation of a variable, but, can be implemented as a macro or a let-binding to a variable on the stack, like in Lisp’s (let ...)
.
I suggest using Unicode characters for these operations and to avoid overloading of the ASCII character “=“. Below is a table of possibilities:
See Also
References: https://guitarvydas.github.io/2024/01/06/References.html
Blog: https://guitarvydas.github.io/
Videos: https://www.youtube.com/@programmingsimplicity2980
Discord: https://discord.gg/Jjx62ypR
Leanpub: https://leanpub.com/u/paul-tarvydas
Gumroad: https://tarvydas.gumroad.com
Twitter: @paul_tarvydas
Is ⇇ different from ⇐?
(Whole-object, field-by-field mutation vs. mutation).
I try to show my thinking as it’s happening, which means that I might show/write things that are unfinished thoughts that may need re-thinking. Readers should remember that I reserve the right to be wrong.
When I was manually preening the code, my “gut” said that I needed two kinds of mutation operators. After I wrote this note, I’m no longer sure as to why I was so adamant about this. Often one’s “gut feel” is correct and, usually, one should go with it, which is what I did in this note. I might remove ⇇ in a few days, after more thought. Comments welcome.