Skip to content

Instantly share code, notes, and snippets.

View bbkr's full-sized avatar

Pawel Pabian bbkr

View GitHub Profile
@bbkr
bbkr / currency.p6
Created July 4, 2012 17:11 — forked from masak/currency.p6
Having fun with currencies in Perl 6
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) {