| 1 | # Copyright (C) 2006-2009, Parrot Foundation. |
|---|
| 2 | # $Id: skeleton.pir 38369 2009-04-26 12:57:09Z fperrad $ |
|---|
| 3 | |
|---|
| 4 | .HLL 'foo' |
|---|
| 5 | |
|---|
| 6 | .sub 'onload' :anon :init :load |
|---|
| 7 | .local pmc meta, pint |
|---|
| 8 | load_bytecode 'P6object.pbc' |
|---|
| 9 | meta = get_root_global ['parrot'], 'P6metaclass' |
|---|
| 10 | meta.'new_class'('FooString', 'parent'=>'parrot;String') |
|---|
| 11 | meta.'new_class'('String','parent'=>'parrot;String') |
|---|
| 12 | pint = get_root_namespace['parrot';'Integer'] |
|---|
| 13 | subclass pint, "Integer" |
|---|
| 14 | .end |
|---|
| 15 | |
|---|
| 16 | .sub main :main |
|---|
| 17 | $P0 = new 'FooString' |
|---|
| 18 | $P0 = 'foo' |
|---|
| 19 | say $P0 |
|---|
| 20 | $P0 = new 'Integer' |
|---|
| 21 | $P0 = 1 |
|---|
| 22 | say $P0 |
|---|
| 23 | $P0 = new 'String' |
|---|
| 24 | $P0 = 'foo' |
|---|
| 25 | say $P0 |
|---|
| 26 | .end |
|---|
| 27 | |
|---|
| 28 | # Local Variables: |
|---|
| 29 | # mode: pir |
|---|
| 30 | # fill-column: 100 |
|---|
| 31 | # End: |
|---|
| 32 | # vim: expandtab shiftwidth=4 ft=pir: |
|---|
| 33 | |
|---|