Skip to content

Instantly share code, notes, and snippets.

Avatar

Pawel Pabian bbkr

View GitHub Profile
@bbkr
bbkr / currency.p6
Created Jul 4, 2012 — forked from masak/currency.p6
Having fun with currencies in Perl 6
View currency.p6
enum Currency <EUR USD>;
multi rate(EUR) { 1.252 }
multi rate(USD) { 1.000 }
class Money {
has Real $.amount;
has Currency $.currency;
method convert_to(Currency $currency) {