[% setvar title Proposal to rename C and C %]

This file is part of the Perl 6 Archive

Note: these documents may be out of date. Do not use as reference!

To see what is currently happening visit http://www.perl6.org/

TITLE

Proposal to rename import and unimport

VERSION

  Maintainer: Jonathan Scott Duff <duff@pobox.com>
  Date: 8 Aug 2000
  Last Modified: 1 Sep 2000
  Mailing List: perl6-language@perl.org
  Number: 74
  Version: 3
  Status: Developing

ABSTRACT

import() and unimport should be IMPORT and UNIMPORT respectively, in keeping with all of the other special-to-Perl names.

DESCRIPTION

The Perl documentation says that

	use Module LIST;

is equivalent to

	BEGIN { require Module; import Module LIST; }

so that use Module LIST automatically calls the import routine for that module if it exists. Thus import is a routine that has special meaning to Perl. This RFC proposes that import and unimport be renamed to IMPORT and UNIMPORT respectively. This would be consistent with the naming of all other subroutines that are special to Perl.

Nathan Wiger <nate@wiger.org> suggests that we create an import keyword (and I assume an unimport keyword as well) that calls import Module LIST. The author of this RFC would rather not add new keywords. However, I see no reason why the module author should not provide an import() routine that is simply an alias for IMPORT().

IMPLEMENTATION

Just change the names!

MIGRATION

The Perl5 -> Perl6 translator should provide a import alias for the IMPORT routine to ease migration. Likewise for unimport.

REFERENCES

Perl 5.6.0 documentation

RFC 59: Proposal to utilize * as the prefix to magic subroutines

Email from Nathan Wiger <nate@wiger.org> that went to perl6-language but I can't find at www.mail-archive.com :-(