Eric wrote:

Since you wouldn't expect an object to stringify or numify...

You wouldn't??! I certainly would.

Object references already stringify/numerify/boolify in Perl 5. Unfortunately, they do so with problematic default behaviours, which is why C<use overload> allows you to overload q{""}, q{0+} and q{bool} (a practice I strongly recommend in "Perl Best Practices").

Finding useful and predictable defaults for the basic coercions on all built-in types is a vital part of the design of Perl 6.

Damian


Reply via email to