4 ms·
I'm very much not sure of the following but I'm going to say it anyway and let folk explain how I'm wrong. :) Each operator and its overloads -- certainly buil
by raiph 11y ago
I'm very much not sure of the following but I'm going to say it anyway and let folk explain how I'm wrong. :)
Each operator and its overloads -- certainly built ins, users are recommended to follow suit -- conceptually maintains its own single high level semantics. Thus, while some langs have a `+` op that does numeric addition or string concat based on operand types, in Perl 6 a `+` will always mean numeric addition (unless a user breaks this convention).
`==` is always numeric value equality.
`==` does what most folk would expect between any pair of values that are a subclass of Any (the root of the type hierarchy for most purposes).
Junction is a direct subclass of Mu (the ultimate root of the type hierarchy), outside the Any hierarchy.
When a scalar operation is applied to one or more Junction values, the relevant operation is "autothreaded" over the superposed values inside the Junctions and returns a new Junction value.
If a Junction is treated as a boolean the Junction collapses to a regular single boolean value.