diff --git a/lib/Heap.pm6 b/lib/Heap.pm6 index f1a0ebd..8f27822 100644 --- a/lib/Heap.pm6 +++ b/lib/Heap.pm6 @@ -69,6 +69,10 @@ role Heap[$heap_cmp = * cmp *] { ::?CLASS.^name ~ ".new: {@!data.gist}"; } + method Numeric { + +@!data + } + method Array { @!data } diff --git a/t/01-test.t b/t/01-test.t index 8108a96..cddbddf 100644 --- a/t/01-test.t +++ b/t/01-test.t @@ -24,6 +24,8 @@ lives-ok { is-deeply $h.Set, [-1, 1].Set; +is +$h, 2, "Numeric"; + my $h1 = Heap.new(1, 2, 3); my $h2 = Heap.new(3, 2, 1);