|
Revision 11276, 0.7 kB
(checked in by lwall, 3 years ago)
|
|
edit examples files that refer to other filenames as *.p6
|
-
Property svn:mime-type set to
text/plain; charset=UTF-8
-
Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 | |
|---|
| 2 | These are examples for creating fake type methods, called |
|---|
| 3 | "virtual methods". See examples/output/vmethods/* for the |
|---|
| 4 | outputs. |
|---|
| 5 | |
|---|
| 6 | Just for getting the idea: |
|---|
| 7 | |
|---|
| 8 | bytes.pl |
|---|
| 9 | |
|---|
| 10 | 5.bytes == 5 |
|---|
| 11 | 1.megabyte == 1048576 |
|---|
| 12 | etc. |
|---|
| 13 | |
|---|
| 14 | time.pl |
|---|
| 15 | |
|---|
| 16 | 1.second == 1 |
|---|
| 17 | 2.seconds == 2 |
|---|
| 18 | 1.minute == 60 |
|---|
| 19 | 10.minutes == 600 |
|---|
| 20 | 1.hour == 3600 |
|---|
| 21 | etc. |
|---|
| 22 | |
|---|
| 23 | 10.minutes.ago == time()-600 |
|---|
| 24 | 10.minutes.from_now == time()+600 |
|---|
| 25 | 10.minutes.until(x) == x-600 |
|---|
| 26 | 10.minutes.since(x) == x+600 |
|---|
| 27 | |
|---|
| 28 | escape.pl |
|---|
| 29 | |
|---|
| 30 | "1<2".escape(:lang<html>) == "1<2" |
|---|
| 31 | |
|---|