Ingy döt Net > Alt-IO-All-new-0.05 > Alt::IO::All::new

Download:
Alt-IO-All-new-0.05.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.05   Source  

NAME ^

Alt::IO::All::new - Alternate IO::All - The Rewrite

SYNOPSIS ^

    > cpanm Alt::IO::All::new

    use IO::All;

DESCRIPTION ^

This is a rewrite of the infamous IO::All. The new design is detailed below.

STATUS ^

This is a very early release. It's just barely operational. Enough to upload to CPAN under the new experimental Alt- namespace.

IO::ALL DESIGN ^

This is a design document for an upcoming version of IO::All.

IO::All is a Perl module that attempts to make all Input/Output operations in Perl, as simple and normal as possible. IO::All has been in existence since 2005. It is useful and somewhat extensible, but has a number of inconsistencies, flaws and misgivings.

This document will propose a better way to do it, and will also discuss how to move the current API forward to the new API.

BASIC PRINCIPLES OF HOW IO::ALL SHOULD WORK ^

IO::ALL PLUGINS ^

Currently the extension API is fairly muddy. I would like the new API to require something like this:

    {
        use strict;
        use IO::All -overload;
        use IO::All::PrintingPress;

        my $io = io('path:to:printing:press#1');
        # is ref($io), 'IO::All';
        $io->print('IO::All');        # calls IO::All::PrintingPress::print
        # is ref($io), 'IO::All::PrintingPress';
    }

So you need to load any extensions that you want to use, within the scope that you want them in. Exceptions are IO::All::File and IO::All::Dir, which are automatically loaded, unless you say:

    use IO::All -none;

Plugins can register 3 things:

These things are register according to the scope of the IO::All, so that the io function will do the right things.

Transition to the new API ^

It needs to be determined if the changes that need to be made are too destructive to coexist with the current IO::All. That determination obviously cannot be made until the new design is complete.

If it is not too destructive, IO::All and its extensions can be brought forward.

If it is too destructive, here is one proposed solution:

Support IO::All 2 <options>;

The version '2' will load IO::All2 (or something) and no version will load the old code.

It is important to assure that the old and new interfaces can coexist in the same process space.

In the IO::All2 scenario, we would need to figure out if the current IO::All extensions also needed forwarding.

SEE ALSO ^

AUTHOR ^

Ingy döt Net <ingy@cpan.org>

COPYRIGHT ^

Copyright 2012-2014. Ingy döt Net.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://www.perl.com/perl/misc/Artistic.html

syntax highlighting: