Overloaded operators: Difference between revisions

Content added Content deleted
(julia example)
Line 225: Line 225:
=={{header|Julia}}==
=={{header|Julia}}==
Most operators in Julia's base syntax are in fact just syntactic sugar for function calls. In particular, the symbols:
Most operators in Julia's base syntax are in fact just syntactic sugar for function calls. In particular, the symbols:
</lang julia>
<lang julia>
* / ÷ % & ⋅ ∘ × ∩ ∧ ⊗ ⊘ ⊙ ⊚ ⊛ ⊠ ⊡ ⊓ ∗ ∙ ∤ ⅋ ≀ ⊼ ⋄ ⋆ ⋇
* / ÷ % & ⋅ ∘ × ∩ ∧ ⊗ ⊘ ⊙ ⊚ ⊛ ⊠ ⊡ ⊓ ∗ ∙ ∤ ⅋ ≀ ⊼ ⋄ ⋆ ⋇
⋉ ⋊ ⋋ ⋌ ⋏ ⋒ ⟑ ⦸ ⦼ ⦾ ⦿ ⧶ ⧷ ⨇ ⨰ ⨱ ⨲ ⨳ ⨴ ⨵ ⨶ ⨷ ⨸ ⨻
⋉ ⋊ ⋋ ⋌ ⋏ ⋒ ⟑ ⦸ ⦼ ⦾ ⦿ ⧶ ⧷ ⨇ ⨰ ⨱ ⨲ ⨳ ⨴ ⨵ ⨶ ⨷ ⨸ ⨻
Line 258: Line 258:
the new type so as to leverage existing code made for analagous base types. This can allow generic
the new type so as to leverage existing code made for analagous base types. This can allow generic
functions to use new types in efficient and constructive ways.
functions to use new types in efficient and constructive ways.



=={{header|Nim}}==
=={{header|Nim}}==