# The following was supposedly scribed by
# David Wheeler
# on Tuesday 04 January 2005 04:55 pm:

>I agree that it should be lowercased; yes, there are modules on CPAN
>that look like pragmas (such as only). I personally would prefer,
>however, that the name tell me that it's doing something more than
>loading a class
<snip>
>I kind of like "aka", actually. 

Me too, except for how it reads in the 'use' statement.

  use aka 'Really::Long::Module::Name';
  use aka 'Really::Long::Conflicting::Module::Name' as "MName";
  use aka 'Another::Silly::Example' import => [qw/foo bar baz/];

That looks like 'use' is Also Known As Really::Long::Module::Name, 
when what we really mean (and therefore want to say) is more like:

  use Really::Long::Module::Name aka Name;

Of course, the 'use' mechanism isn't able to do this at present (that 
is:  pragmas don't even work this way), so maybe one of the other 
names is in order.  'alias' as an adverb doesn't work in that order 
either, but works as a verb, which is sort-of where you're stuck 
unless you build this functionality into the use() function.

Of course, alias as a verb isn't in the dictionary, we geeks just read 
it that way because of the bash function.  It any case, it seems that 
'alias.pm' might get confused with 'Alias.pm'.

Now I'm strapped to come-up with a verb which doesn't sound so 
nounish.  Consulting the resident linguist (aka wife) results in 
'dub' (as in 'I dub thee'), so I'll throw that out as a suggestion.

  use dub 'Really::Long::Module::Name' as 'Name';

That also seems to work well as an alternative to the use function 
rather than a module or pragma (yeah, perl needs more functions in 
the core.)

  dub Long::Name;
  dub Long::Name as Name;

As for the interface, I really like the 'as' part, but the 'import => 
[qw(stuff)]' seems clunky.  Is there a reason that this syntax can't 
work:

  use dub 'Long::Name' qw(foo bar baz);
  use dub 'Long::Name' as 'Name' qw(foo bar baz);

--Eric
-- 
"Chess is a foolish expedient for making idle people believe 
they are doing something very clever when they are only wasting 
their time."
                                        --George Bernard Shaw

Reply via email to