Hacker News new | ask | show | jobs
by kqr 2793 days ago
I have no problem reading that. Sure, I dont understand it in fine technical detail (what's Mu? An implementation of Perl? A codename for Perl 6?) But I believe I understand enough of it to start using it.

This specific example seems similar to the __repr__ vs __str__ thing in Python, and not very alien at all.

3 comments

As pointed out by others, Mu is the most undefined value there is in Perl 6 and the base root for the immediate child classes (https://docs.perl6.org/images/type-graph-Mu.svg). However, most classes (both built-in and user-defined ones) don't inherit directly from it. Instead, they inherit from Any, which in turns inherits from Mu.

More info about it:

- https://docs.perl6.org/type/Mu

- https://en.wikipedia.org/wiki/Mu_%28negative%29

Right. Here's a blog post, which, while not directly about Mu (it's about m, a shell script I wrote), has many excerpts about (the original) Mu (from which Perl6's Mu descends, pun intended, ha ha) near the end - some may find them interesting:

m, a Unix shell utility to save cleaned-up man pages as text:

https://jugad2.blogspot.com/2017/03/m-unix-shell-utility-to-...

`Mu` is perl6's `Object` ("mu" ≈ "nothing" in chinese/japanese). cute, but alien
Also, "most undefined".
Thanks for pointing out this Python similarity!