On 9/16/18 8:59 PM, Brandon Allbery wrote:
Also, going by math calling the "real numbers" misses that math treats
integers as a subset of real numbers; there is no hard distinction
between them in math. Computers need hard distinctions here because
integral, rational, and floating point numbers must be stored in
different ways, unless they take the PHP / Javascript solution (storing
them all as strings or floating point, respectively). Perl 6's Real is a
role that the actual types "does" if they are compatible with it.
If you want to do the Perl 5-ish thing where it hid the differences (and
sometimes promoted an integral value to floating without asking, never
to return), use the Real role as a type to hide the difference between
them. If you want to be specific, use the correct type.
Got it. A "Role" is a superset of "types"