Created
August 10, 2009 06:01
-
-
Save treed/165025 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[23:11] [inara:/Users/treed/code/cardinal]% ../parrot/parrot test.pir | |
foo | |
1 | |
set_string_native() not implemented in class 'String' | |
current instr.: 'main' pc 56 (test.pir:24) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (C) 2006-2009, Parrot Foundation. | |
# $Id: skeleton.pir 38369 2009-04-26 12:57:09Z fperrad $ | |
.HLL 'foo' | |
.sub 'onload' :anon :init :load | |
.local pmc meta, pint | |
load_bytecode 'P6object.pbc' | |
meta = get_root_global ['parrot'], 'P6metaclass' | |
meta.'new_class'('FooString', 'parent'=>'parrot;String') | |
meta.'new_class'('String','parent'=>'parrot;String') | |
pint = get_root_namespace['parrot';'Integer'] | |
subclass pint, "Integer" | |
.end | |
.sub main :main | |
$P0 = new 'FooString' | |
$P0 = 'foo' | |
say $P0 | |
$P0 = new 'Integer' | |
$P0 = 1 | |
say $P0 | |
$P0 = new 'String' | |
$P0 = 'foo' | |
say $P0 | |
.end | |
# Local Variables: | |
# mode: pir | |
# fill-column: 100 | |
# End: | |
# vim: expandtab shiftwidth=4 ft=pir: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment