I noticed in pugs, 'ref' does not return 'HASH' and 'ARRAY' as Perl5
does, but returns values including 'Hash', 'Array' and 'Array::Const'.

I don't find meaningful mentions of 'HASH' and 'ARRAY' by grep'ing
docs/Perl6 (or even "ref"!), so I wanted to check in here about the
meaningfulness of this change.

Personally, I dislike the change from HASH to 'Hash' because it seems to
 be change without a significant benefit. It's annoyingly different.

The ARRAY case is worse, because it seems I now need to write this:

 if ref $a eq any('Array','Array::Const')  {

If you are interested, here's code which illustrates cases when
'Array' is returned, versus 'Array::Const'

 my $a = [<a>];
 my $b = \@('b');

 say ref $a;
 say ref $b;

I'd like for 'HASH' and 'ARRAY' to keep working, or for the Perl6 docs
to justify the change.

   Mark

Reply via email to