foo
[gitmo/Moose-Autobox.git] / lib / Moose / Autobox.pm
CommitLineData
5f654d8e 1
2package Moose::Autobox;
3
4use strict;
5use warnings;
6
31d40d73 7use Carp qw(confess);
5f654d8e 8use Scalar::Util ();
9
10our $VERSION = '0.01';
11
6cf5bcf2 12#sub import {
13# eval q|
5f654d8e 14package SCALAR;
31d40d73 15
16# NOTE:
17# this doesnt make sense, but
18# I need to prevent Moose from
19# assiging to @ISA
20use base 'Moose::Autobox';
21
5f654d8e 22use Moose;
23with 'Moose::Autobox::Scalar';
24
31d40d73 25*does = \&Moose::Object::does;
26
5f654d8e 27package ARRAY;
31d40d73 28use base 'Moose::Autobox';
5f654d8e 29use Moose;
30with 'Moose::Autobox::Array';
31
31d40d73 32*does = \&Moose::Object::does;
33
5f654d8e 34package HASH;
31d40d73 35use base 'Moose::Autobox';
5f654d8e 36use Moose;
37with 'Moose::Autobox::Hash';
38
31d40d73 39*does = \&Moose::Object::does;
40
5f654d8e 41package CODE;
31d40d73 42use base 'Moose::Autobox';
5f654d8e 43use Moose;
31d40d73 44with 'Moose::Autobox::Code';
45
46*does = \&Moose::Object::does;
47
6cf5bcf2 48# |;
49# confess 'Could not create autobox packages because - ' . $@ if $@;
50#}
5f654d8e 51
521;
53
54__END__
55
56=pod
57
58=head1 NAME
59
60Moose::Autobox - autoboxed for her pleasure
61
62=head1 SYNOPOSIS
63
39894c95 64 use Moose::Autobox;
65 use autobox;
31d40d73 66
67 'Print squares from 1 to 10'->print;
68 [ 1 .. 10 ]->map(sub { $_ * $_ })->join(', ')->print;
39894c95 69
5f654d8e 70=head1 DESCRIPTION
71
39894c95 72=head1 ROLES
260cc81f 73
74 +------------------------+-------------------------------+
75 | Identity | Behavioral |
76 +------------------------+-------------------------------+
77 | Item | |
78 | Undef | |
79 | Defined | |
80 | Scalar* <-|- String, Number <--+ |
81 | Ref | |-- Value |
82 | Array* <-|- List <------------+ |
83 | Hash* | |
84 | Code* | |
85 | | |
86 +------------------------+-------------------------------+
87
39894c95 88 * indicates actual autoboxed types
31d40d73 89
90=head1 NOTES
91
92 - String, Number & List are currently the only Values.
93
94 - Indexed is pretty much an interface, we probably will
95 need more of these (see Smalltalk Collection Trait
96 Refactoring)
97
5f654d8e 98=head1 BUGS
99
100All complex software has bugs lurking in it, and this module is no
101exception. If you find a bug please either email me, or add the bug
102to cpan-RT.
103
104=head1 AUTHOR
105
106Stevan Little E<lt>stevan@iinteractive.comE<gt>
107
108=head1 COPYRIGHT AND LICENSE
109
110Copyright 2006 by Infinity Interactive, Inc.
111
112L<http://www.iinteractive.com>
113
114This library is free software; you can redistribute it and/or modify
115it under the same terms as Perl itself.
116
5f654d8e 117=cut