Skip to content

Instantly share code, notes, and snippets.

View codesections's full-sized avatar

Daniel Sockwell codesections

View GitHub Profile
@codesections
codesections / omni-sigil.raku
Created December 21, 2022 14:26
A Raku class that implements all three of the Positional, Associative, and Callable roles
#| A class that implements the Positional, Associative, and Callable roles.
#| Accordingly, this type can be bound variables with any sigil
class Seuss does Positional does Associative does Callable does Iterable {
has @.pos handles <AT-POS EXISTS-POS DELETE-POS ASSIGN-POS BIND-POS elems>
= Nil, '🐠', '<°))))><';
has %.asc handles <AT-KEY EXISTS-KEY DELETE-KEY ASSIGN-KEY BIND-KEY>
= (:blue<🐟>, :red<🐡>);
method of { Mu }