Skip to content

Commit

Permalink
Move Callable role out of builtins and into core setting.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmichaud committed Jul 4, 2010
1 parent 7b6444c commit f4209ee
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 107 deletions.
7 changes: 4 additions & 3 deletions build/Makefile.in
Expand Up @@ -118,7 +118,6 @@ BUILTINS_PIR = \
src/builtins/Str.pir \
src/builtins/Enum.pir \
src/builtins/Pair.pir \
src/builtins/Callable.pir \
src/builtins/Code.pir \
src/builtins/Block.pir \
src/builtins/Routine.pir \
Expand Down Expand Up @@ -169,6 +168,9 @@ CHEATS_PIR = \
src/cheats/parrot/register.pir \

CORE_SOURCES = \
src/core/Positional.pm \
src/core/Associative.pm \
src/core/Callable.pm \
src/core/traits.pm \
src/core/metaops.pm \
src/core/operators.pm \
Expand All @@ -177,13 +179,12 @@ CORE_SOURCES = \
src/cheats/trait-export.pm \
src/cheats/num.pm \
src/cheats/eval.pm \
src/core/Positional.pm \
src/core/Associative.pm \
src/core/Mu.pm \
src/core/Bool.pm \
src/core/Parcel.pm \
src/core/Any.pm \
src/core/Any-list.pm \
src/core/Code.pm \
src/core/Cool.pm \
src/core/Cool-num.pm \
src/core/Cool-str.pm \
Expand Down
102 changes: 0 additions & 102 deletions src/builtins/Callable.pir

This file was deleted.

3 changes: 1 addition & 2 deletions src/builtins/Code.pir
Expand Up @@ -16,8 +16,7 @@ for executable objects.
.sub 'onload' :anon :load :init
.local pmc p6meta, codeproto
p6meta = get_hll_global ['Mu'], '$!P6META'
$P0 = get_hll_global 'Callable'
codeproto = p6meta.'new_class'('Code', 'parent'=>'Cool', 'attr'=>'$!do $!multi', 'does_role'=>$P0)
codeproto = p6meta.'new_class'('Code', 'parent'=>'Cool', 'attr'=>'$!do $!multi')
$P1 = new ['Role']
$P1.'name'('invokable')
p6meta.'compose_role'(codeproto, $P1)
Expand Down
4 changes: 4 additions & 0 deletions src/core/Callable.pm
@@ -0,0 +1,4 @@
role Callable[::T = Mu] {
method of() { T }
method returns() { T }
}
1 change: 1 addition & 0 deletions src/core/Code.pm
@@ -0,0 +1 @@
augment class Code does Callable { }

0 comments on commit f4209ee

Please sign in to comment.