From 872f958cda735d0dbb486e58779da44596562741 Mon Sep 17 00:00:00 2001 From: Stefan O'Rear Date: Sat, 24 Jul 2010 18:57:32 -0700 Subject: [PATCH] Remove !HOW fossil --- CORE.setting | 20 ++++++++++---------- Decl.pm | 12 ++++-------- Niecza/Actions.pm | 1 - Op.pm | 2 +- 4 files changed, 15 insertions(+), 20 deletions(-) diff --git a/CORE.setting b/CORE.setting index 19defb5c..aa501944 100644 --- a/CORE.setting +++ b/CORE.setting @@ -24,7 +24,7 @@ my module CORE; # } # # to augment: -# BEGIN { $Foo_HOW.add-method("baz", anon method baz { ... }); } +# BEGIN { Foo.HOW.add-method("baz", anon method baz { ... }); } my class ClassHOW { ... } PRE-INIT { @@ -42,12 +42,12 @@ PRE-INIT { [ns (l $self)]) } } - # $how.add-super($how) + # $how.add-super($p) sub add-super { Q:CgOp { (prog [rawcall (getfield superclasses (unwrap DynMetaObject (getattr meta-object (@ (pos 0))))) Add - (unwrap DynMetaObject (getattr meta-object (@ (pos 1))))] + (unwrap DynMetaObject (getattr meta-object (how (@ (pos 1)))))] [null Variable]) } } @@ -99,7 +99,6 @@ PRE-INIT { (wrap (clr_string "create-protoobject")) (l &create-protoobject))] [l ClassHOW (subcall (@ (l &create-protoobject)) (l $chch))] - [l ClassHOW!HOW (l $chch)] [null Variable]) } @@ -126,30 +125,31 @@ PRE-INIT { } } Q:CgOp { - (withtypes !plist List + (withtypes !plist List Mu!HOW Variable Any!HOW Variable + Cool!HOW Variable Scalar!HOW Variable Sub!HOW Variable [l Mu!HOW (methodcall (l ClassHOW) new (w (clr_string Mu)))] [l Mu (methodcall (l Mu!HOW) create-protoobject)] [l Any!HOW (methodcall (l ClassHOW) new (w (clr_string Any)))] - [sink (methodcall (l Any!HOW) add-super (l Mu!HOW))] + [sink (methodcall (l Any!HOW) add-super (l Mu))] [l Any (methodcall (l Any!HOW) create-protoobject)] [rawsset Kernel.AnyP (@ (l Any))] [l Cool!HOW (methodcall (l ClassHOW) new (w (clr_string Cool)))] - [sink (methodcall (l Cool!HOW) add-super (l Any!HOW))] + [sink (methodcall (l Cool!HOW) add-super (l Any))] [l Cool (methodcall (l Cool!HOW) create-protoobject)] - [sink (methodcall (l ClassHOW!HOW) add-super (l Any!HOW))] + [sink (methodcall (ns (how (@ (l ClassHOW)))) add-super (l Any))] [rawcall (getfield klass (cast DynObject (@ (l ClassHOW)))) BuildC3MRO] [l Sub!HOW (subcall (@ (l &wrap-dpmo)) - (w (rawsget Kernel.SubMO)) (l Any!HOW))] + (w (rawsget Kernel.SubMO)) (l Any))] [l Sub (methodcall (l Sub!HOW) create-protoobject)] [l Scalar!HOW (subcall (@ (l &wrap-dpmo)) - (w (rawsget Kernel.ScalarMO)) (l Any!HOW))] + (w (rawsget Kernel.ScalarMO)) (l Any))] [l Scalar (methodcall (l Scalar!HOW) create-protoobject)] [null Variable]) diff --git a/Decl.pm b/Decl.pm index 8b7992eb..4f522cb5 100644 --- a/Decl.pm +++ b/Decl.pm @@ -279,11 +279,10 @@ use CgOp; sub extra_decls { $_[0]->body ? ($_[0]->body->floated_decls) : () } sub stashvar { $_[0]->var . '::' } - sub metavar { $_[0]->var . '!HOW' } sub used_slots { my ($self) = @_; - $self->var, 'Variable', $self->stashvar, 'Variable', $self->metavar, + $self->var, 'Variable', $self->stashvar, 'Variable', (!$self->stub ? ($self->bodyvar, 'Variable') : ()); } @@ -296,7 +295,6 @@ use CgOp; if ($self->stub) { return CgOp::prog( CgOp::proto_var($self->var, CgOp::newscalar(CgOp::null('IP6'))), - CgOp::proto_var($self->metavar, CgOp::newscalar(CgOp::null('IP6'))), CgOp::proto_var($self->stashvar, CgOp::wrap(CgOp::rawnew('Dictionary')))); } @@ -308,7 +306,6 @@ use CgOp; CgOp::letn("how", $self->make_how, # catch usages before the closing brace CgOp::proto_var($self->var, CgOp::newscalar(CgOp::null('IP6'))), - CgOp::proto_var($self->var . '!HOW', CgOp::letvar("how")), CgOp::proto_var($self->var . "::", CgOp::letvar("pkg")), CgOp::proto_var($self->bodyvar, @@ -322,7 +319,6 @@ use CgOp; CgOp::prog( CgOp::share_lex($self->var), CgOp::share_lex($self->var . "::"), - CgOp::share_lex($self->var . "!HOW"), ($self->stub ? () : ($body->mainline ? CgOp::share_lex($self->bodyvar) : @@ -360,7 +356,7 @@ use CgOp; CgOp::wrap(CgOp::clr_string($self->name // 'ANON'))); } - sub defsuper { 'Any!HOW' } + sub defsuper { 'Any' } sub finish_obj { my ($self) = @_; @@ -382,7 +378,7 @@ use CgOp; use Moose; extends 'Decl::Class'; - sub defsuper { 'Grammar!HOW' } + sub defsuper { 'Grammar' } __PACKAGE__->meta->make_immutable; no Moose; @@ -428,7 +424,7 @@ use CgOp; CgOp::sink( CgOp::methodcall(CgOp::letvar('how'), "add-super", - CgOp::scopedlex($self->name . "!HOW"))); + CgOp::scopedlex($self->name))); } __PACKAGE__->meta->make_immutable; diff --git a/Niecza/Actions.pm b/Niecza/Actions.pm index 6c828099..ec606b35 100644 --- a/Niecza/Actions.pm +++ b/Niecza/Actions.pm @@ -1026,7 +1026,6 @@ sub statement_control__S_use { my ($cl, $M) = @_; my %symbols; $symbols{$name} = [ $name ]; $symbols{$name . '::'} = [ $name . '::' ]; - $symbols{$name . '!HOW'} = [ $name . '!HOW' ]; my $pkg = $M->find_stash($name); if ($pkg->{really}) { diff --git a/Op.pm b/Op.pm index a2d83601..19962d13 100644 --- a/Op.pm +++ b/Op.pm @@ -435,7 +435,7 @@ use CgOp; bodyvar => $self->bodyvar))); for my $tag (@{ $self->exports }) { - for my $sym ($self->var, $self->var . '::', $self->var . '!HOW') { + for my $sym ($self->var, $self->var . '::') { push @r, Decl::PackageAlias->new(slot => $sym, name => $sym, path => [ 'OUR', 'EXPORT', $tag ]); }