On 4/28/06, Larry Wall <[EMAIL PROTECTED]> wrote:
How about Bag, a set container?  Alternately what we really want is
just a Hash where the type of the value is defined as 1, so it need
not be stored at all.  Then most of the syntax for it just falls out
of Hash syntax, unless you like writing $x ∈ $bag instead of $bag{$x}.
Presumably we could make both work.

It seems like a hash whose values are the unit type.  Does Perl have a
unit type?  I suppose if it doesn't, we could define one:

   subtype Unit of Int where 1;

(Assuming that "where" groks whatever "when" does).

Then your mutable set is:

   my Hash of Unit $set;

Luke

Reply via email to