develooper Front page | perl.perl5.porters | Postings from August 2012

Re: fixing smartmatch just hard enough (and when, too)

Thread Previous | Thread Next
From:
Damian Conway
Date:
August 23, 2012 01:07
Subject:
Re: fixing smartmatch just hard enough (and when, too)
Message ID:
CAATtAp4q2kNhpG2_a56KpYsvKLu5_ybdcRh6C+sZ_bpwgu-C=Q@mail.gmail.com
Johan Vromans asked:

>>     $Zero ~~ *GLOB    # unmatchable (invalid type) -----> undef
>>     $Zero ~~ \%HASH   # unmatchable (invalid type) -----> undef
>>     $Zero ~~ \@ARRAY  # unmatchable (invalid type) -----> undef
>
> Syntax error?

Possibly. Ideally, even.
But I don't insist on it (mainly because I'm not volunteering to
implement it ;-)

In any case, the following are still exactly the same problem and they
certainly
can't be resolved by the parser (or at compile-time):

    $Zero ~~ $GLOB_ref   # unmatchable (invalid type) -----> undef
    $Zero ~~ $HASH_ref   # unmatchable (invalid type) -----> undef
    $Zero ~~ $ARRAY_ref  # unmatchable (invalid type) -----> undef


Damian

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About