On Wed, Aug 23, 2006 at 04:10:32PM -0700, Larry Wall wrote:
> Yes, that should work eventually, given that hypers are supposed to stop
> after the longest *finite* sequence.  In theory you could even say
>     my %trans = ('a'..*) »=>« ('?' xx *);
> but we haven't tried to define what the semantics of a lazy hash would be...

That's a rather large hazard.  %trans{$key} would run until
the lazy hash is extended far enough to determine whether
$key is ever matched as a key - and that could easily mean
trying forever.  So, it is only safe to use the hash for
keys that you *know* are in the domain; or, if the lazy
key generation is simple enough, keys that you *know* can
be excluded in a finite amount of time.  (I'm assuming that
1 ~~ any( 5..* ) will be smart enough to return false.)


Reply via email to