Skip to content

Instantly share code, notes, and snippets.

@treed
Created August 10, 2009 06:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save treed/165025 to your computer and use it in GitHub Desktop.
Save treed/165025 to your computer and use it in GitHub Desktop.
[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)
# 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