Skip to content

Commit

Permalink
Revert "[src/glue/enum.pm] return the right things"
Browse files Browse the repository at this point in the history
This reverts commit 5fe1939.
It broke lots of stuff wrt loaded modules, which would segfault.
I don't know if this commit was actually to blame, or if it only exposed bugs,
but the result was not acceptable. Sorry.
  • Loading branch information
moritz committed Jul 24, 2010
1 parent 4cdba6b commit f7fdd51
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions src/glue/enum.pm
Expand Up @@ -4,27 +4,11 @@ our sub SETUP_NAMED_ENUM($name, $values) {
# For now, just install EnumMap under the main name.
my @full_ns = Perl6::Grammar::parse_name($name);
my ($shortname, @base_ns) = @full_ns;
my $enumeration-object = (class {
method WHAT { $enumeration-object }
method enums { $values }
method Str { $name }
}).new;
pir::set_hll_global__vPSP(@base_ns, $shortname, $enumeration-object);

pir::set_hll_global__vPSP(@base_ns, $shortname, $values);

for $values.kv -> $key, $value {
my $enum-object = $value but role {
method WHAT { $enumeration-object }
method perl { $name ~ '::' ~ $key }
method Str { $name ~ '::' ~ $key }
method Stringy { $key }
method key { $key }
method value { $value }
method pair { $key => $value }
method kv { $key, $value }
method defined { True }
};
pir::set_hll_global__vPSP(@full_ns, $key, $enum-object);
pir::set_hll_global__vPSP(@base_ns, $key, $enum-object);
pir::set_hll_global__vPSP(@full_ns, $key, $value);
pir::set_hll_global__vPSP(@base_ns, $key, $value);
}
}

Expand Down

0 comments on commit f7fdd51

Please sign in to comment.