develooper Front page | perl.perl6.language | Postings from February 2004

uc import

Thread Next
From:
Brent "Dax" Royal-Gordon
Date:
February 23, 2004 22:23
Subject:
uc import
Message ID:
403AEDB3.9060708@brentdax.com
(Apologies if this is a repeat--I tried to send something on the same 
subject a few days ago, but apparently it didn't get through.)

A few weeks ago, my father and I were discussing Perl.  (He is a 
professional programmer of about twenty-five years; the last seven or so 
have been spent building Visual FoxPro apps for a major financial 
institution.)  I ended up explaining Perl's module loading mechanism to 
him; he agreed that the concept was elegant, but thought that calling 
the subroutine "import" was a bad idea, because it kept users from 
creating a sub with that name for other purposes.

It occurred to me that Perl has a "syntax" in place for dealing with 
this problem--subroutines with special purposes have names in all-caps. 
  (Besides all the blocks like BEGIN and END, consider DESTROY.  I also 
seem to remember that there's an all-caps object initializing method in 
Perl 6.)  I suggest that this mechanism be extended to import, making it 
IMPORT instead.  This would return to the module writer's domain a 
common English word that is often used in computer contexts, which is 
probably a Good Thing.

Of course, this entire post assumes that import isn't going away entirely.

--Brent "Dax" Royal-Gordon <brent@brentdax.com>
Perl and Parrot hacker

Oceania has always been at war with Eastasia.

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About