HaloO,

Dr.Ruud wrote:
What would be the way to define-or-set that a specific hash has
non-case-sensitive keys?


There are two things in this:
 (1) The syntax to type the keys of a hash---too bad that I forgot it
     and currently don't find it in the Synopsyses. Pointers welcome!
 (2) A way to constrain a string to be case insensitive.

The latter could be nicely stated as

  subset CaseInsensitive of Str where { .lc eq .uc }

but it actually is a constraint on the &infix:<eq>, not on
the strings. So I doubt that it works as expected. But then
I'm not sure if one can make subsets of operators at all:

  subset CaseInsensitive of eq where { .lc eq .uc }

I guess you have to simply define CaseInsensitive as an alias---that is
an unconstraint subset---and overload &infix:<eq>. Then the hash
hopefully uses this operator when its key type is CaseInsensitive.
--

Reply via email to