On Mar 8, 2011, at 11:09 AM, Marvin Humphrey wrote: > On Tue, Mar 08, 2011 at 09:40:30AM -0800, David E. Wheeler wrote: >> Lucy::Tokenizer::Regex please! > > Sorry, but due to C's flat namespace we have a limitation in our class naming > scheme which excludes that possibility. The last part of the class name is > used for the C struct name, which means that at the C level, an object > belonging to the class "Lucy::Tokenizer::Regex" would be a "Regex". That's > obviously inappropriate.
I suggest bending C to Perl's namespacing rather than the other way around. It doesn't take a lot of munging to get what you want: package Lucy::Tokenizer::Regex; (my $cname = __PACKAGE__) =~ s/^Lucy:://; $cname = join '', reverse split /::/ => $cname; say $cname; # TokenizerRegex Best, David
