|
Revision 11293, 0.7 kB
(checked in by Darren_Duncan, 3 years ago)
|
|
replaced all 'use v6;' lines with 'use v6-alpha;' in 330 files (examples/, ext/, t/, t_disabled/) ... more remain to do
|
-
Property svn:mime-type set to
text/plain; charset=UTF-8
-
Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 | # Please remember to update examples/output/vmethods/bytes if you change this |
|---|
| 2 | # file so its output will change. |
|---|
| 3 | # |
|---|
| 4 | # originally based on Ruby's ActiveSupport 1.0.4 |
|---|
| 5 | # |
|---|
| 6 | |
|---|
| 7 | use v6-alpha; |
|---|
| 8 | |
|---|
| 9 | multi sub bytes (Int $value:) { |
|---|
| 10 | $value; |
|---|
| 11 | } |
|---|
| 12 | |
|---|
| 13 | our &byte:=&bytes; |
|---|
| 14 | |
|---|
| 15 | multi sub kilobytes (Int $value:) { |
|---|
| 16 | $value * 1024; |
|---|
| 17 | } |
|---|
| 18 | |
|---|
| 19 | our &kilobyte:=&kilobytes; |
|---|
| 20 | |
|---|
| 21 | multi sub megabytes (Int $value:) { |
|---|
| 22 | $value * 1024.kilobytes; |
|---|
| 23 | } |
|---|
| 24 | |
|---|
| 25 | our &megabyte:=&megabytes; |
|---|
| 26 | |
|---|
| 27 | multi sub gigabytes (Int $value:) { |
|---|
| 28 | $value * 1024.megabytes; |
|---|
| 29 | } |
|---|
| 30 | |
|---|
| 31 | our &gigabyte:=&gigabytes; |
|---|
| 32 | |
|---|
| 33 | multi sub terabytes (Int $value:) { |
|---|
| 34 | $value * 1024.gigabytes; |
|---|
| 35 | } |
|---|
| 36 | |
|---|
| 37 | our &terabyte:=&terabytes; |
|---|
| 38 | |
|---|
| 39 | say "5 bytes is " ~ 5.bytes ~ " bytes."; |
|---|
| 40 | say "5 kilobytes is " ~ 5.kilobytes ~ " bytes."; |
|---|
| 41 | say "1 megabyte is " ~ 1.megabyte ~ " bytes."; |
|---|