Skip to content

Commit

Permalink
Stub in AttributeDeclarand and ContainerDeclarand, as a start to gett…
Browse files Browse the repository at this point in the history
…ing something in place for trait application to container declarations. Based on discussion on #perl6, and not spec yet.
  • Loading branch information
jnthn committed Aug 18, 2009
1 parent 6c7b8b3 commit b9c79c2
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
2 changes: 2 additions & 0 deletions build/Makefile.in
Expand Up @@ -86,6 +86,8 @@ BUILTINS_PIR = \
src/classes/Positional.pir \
src/classes/Associative.pir \
src/classes/Callable.pir \
src/classes/ContainerDeclarand.pir \
src/classes/AttributeDeclarand.pir \
src/classes/Bool.pir \
src/classes/Str.pir \
src/classes/Num.pir \
Expand Down
31 changes: 31 additions & 0 deletions src/classes/AttributeDeclarand.pir
@@ -0,0 +1,31 @@
## $Id$

=head1 NAME

src/classes/AttributeDeclarand.pir - Class specifying an attribute declaration

=head1 DESCRIPTION

This is the class that gets created and passed to a trait_mod to
describe a declaration of an attribute container in a class.

=cut

.namespace []

.sub '' :anon :load :init
.local pmc p6meta
p6meta = get_hll_global ['Perl6Object'], '$!P6META'
p6meta.'new_class'('AttributeDeclarand', 'parent'=>'ContainerDeclarand', 'attr'=>'$!how')
.end

.sub 'how' :method
$P0 = getattribute self, '$!how'
.return ($P0)
.end

# Local Variables:
# mode: pir
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir:
36 changes: 36 additions & 0 deletions src/classes/ContainerDeclarand.pir
@@ -0,0 +1,36 @@
## $Id$

=head1 NAME

src/classes/ContainerDeclarand.pir - Class specifying a declaration

=head1 DESCRIPTION

This is the class that gets created and passed to a trait_mod to
describe a declaration of a container.

=cut

.namespace []

.sub '' :anon :load :init
.local pmc p6meta
p6meta = get_hll_global ['Perl6Object'], '$!P6META'
p6meta.'new_class'('ContainerDeclarand', 'parent'=>'Any', 'attr'=>'$!container $!name')
.end

.sub 'container' :method
$P0 = getattribute self, '$!container'
.return ($P0)
.end

.sub 'name' :method
$P0 = getattribute self, '$!name'
.return ($P0)
.end

# Local Variables:
# mode: pir
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir:

0 comments on commit b9c79c2

Please sign in to comment.