Skip to content

Comment on Perl6: Unary Sortparent

Comments

Perl 6 has proper types. If you produce a string, you are producing a Str object (well, technically it could be an object that does the Stringy role, but I don't think there are any other Stringy types implemented yet) and it will compare as a string, not a number, no matter what it looks like.

Likewise, if you produce a number, you have an object which does the Numeric role, and it will compare as a number.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.