[% setvar title Eliminate dump() function %]

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

Eliminate dump() function

VERSION

  Maintainer: Dominus <mjd@plover.com>
  Date: 20 Sep 2000
  Mailing List: perl6-language@perl.org
  Number: 267
  Version: 1
  Status: Developing

ABSTRACT

Get rid of it completely.

DESCRIPTION

dump is a common subroutine name. People often try to define a dump subroutine and then get puzzled by the dump. They have to name their dump functions 'Dump' or 'dumper' and then they get annoying errors when they call dump instead by mistake.

dump is not very useful anyway; see MIGRATION below.

IMPLEMENTATION

None needed.

MIGRATION

The translator should translate calls to dump() to

        kill 6 => $$;

instead.

If the translator fails on dump LABEL, that is probably all right. But if not, then it can translate

        ...
        dump LABEL;
        ...

        LABEL: 
        ...

to

        ...
        ${^Please_Dump} = 1;
        goto LABEL;
        ...

        LABEL:
        kill 6 => $$ if ${^Please_Dump};
        undef ${^Please_Dump};
        ...

REFERENCES

perlfunc manpage for discussion of dump()