develooper Front page | perl.perl6.users | Postings from February 2020

Hash Constraints w/in subset's

Thread Next
Paul Procacci
February 1, 2020 08:58
Hash Constraints w/in subset's
Message ID:
Hey ladies/gents,

How would one go about defining a subset of a Hash who's key's and values
are both constrained by something ....

I've read and it does make mention of
constraining keys and values, but not within the context of a subset.
Before I go ripping my hair out, I want to make sure I'm doing things right.

For instance, what if I want to define a subset that uses a Hash as it's
base class, in which I want to add the constraint that it's keys must be
strings yet it's values are constrained to only accept Int's?

Thanks in Advance!


:(){ :|:& };:

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About