base-2.14 > 2.22 との差分

base 2.22 と 2.14 の差分

11
22=encoding euc-jp
33
44=head1 NAME
55
66=begin original
77
88base - Establish an ISA relationship with base classes at compile time
99
1010=end original
1111
1212base - コンパイル時に基底クラスとの ISA 関係を構築する
1313
1414=head1 SYNOPSIS
1515
1616 package Baz;
1717 use base qw(Foo Bar);
1818
1919=head1 DESCRIPTION
2020
2121=begin original
2222
2323Unless you are using the C<fields> pragma, consider this module discouraged
2424in favor of the lighter-weight C<parent>.
2525
2626=end original
2727
2828C<fields> プラグマを使っているのでない限り、このモジュールは非推奨です;
2929代わりに軽量な C<parent> を使ってください。
3030
3131=begin original
3232
3333Allows you to both load one or more modules, while setting up inheritance from
3434those modules at the same time. Roughly similar in effect to
3535
3636=end original
3737
3838一つまたは複数のモジュールを読み込んで、それらのモジュールから継承するのを
3939同時に行います。
4040おおよそ次のような効果があります:
4141
4242 package Baz;
4343 BEGIN {
4444 require Foo;
4545 require Bar;
4646 push @ISA, qw(Foo Bar);
4747 }
4848
4949=begin original
5050
51When C<base> tries to C<require> a module, it will not die if it cannot find
51C<base> employs some heuristics to determine if a module has already been
52the module's file, but will die on any other error. After all this, should
52loaded, if it has it doesn't try again. If C<base> tries to C<require> the
53your base class be empty, containing no symbols, C<base> will die. This is
53module it will not die if it cannot find the module's file, but will die on any
54useful for inheriting from classes in the same file as yourself but where
54other error. After all this, should your base class be empty, containing no
55the filename does not match the base module name, like so:
55symbols, it will die. This is useful for inheriting from classes in the same
56file as yourself, like so:
5657
5758=end original
5859
60モジュールが既に読み込まれている場合、再び行わないようにするために
61C<base> は宣言に経験則を用います。
5962C<base> がモジュールを C<require> しようとしたとき、モジュールのファイルが
6063見つからなくても die しません。
6164しかしその他のエラーでは die します。
62これら全ての後、基底クラスが空で、シンボルを含んでいない場合、
65これら全ての後、基底クラスが空で、シンボルを含んでいない場合、die します。
63C<base> die しま
66これ次のように、自分自身で同じファイルのクラスから継承るのに有用です:
64これは次のように、自分自身で同じファイルにあるけれども
65ファイル名が基底モジュール名と一致しないクラスから継承するのに有用です:
6667
67 # in Bar.pm
6868 package Foo;
6969 sub exclaim { "I can have such a thing?!" }
70
7171 package Bar;
7272 use base "Foo";
7373
7474=begin original
7575
76There is no F<Foo.pm>, but because C<Foo> defines a symbol (the C<exclaim>
76If $VERSION is not detected even after loading it, <base> will define $VERSION
77subroutine), C<base> will not die when the C<require> fails to load F<Foo.pm>.
77in the base package, setting it to the string C<-1, set by base.pm>.
7878
7979=end original
8080
81F<Foo.pm> はありませんが、C<Foo> はシンボル (C<exclaim> サブルーチン) を
81ロードの後でも $VERSION 検出されなかった場合
82定義しているので、C<base> は C<require> が F<Foo.pm> の読み込みに失敗ても
82<base> は基底パッケージで $VERSION を定義、文字列
83die しません
83C<-1, set by base.pm> を設定しま
8484
8585=begin original
8686
8787C<base> will also initialize the fields if one of the base classes has it.
8888Multiple inheritance of fields is B<NOT> supported, if two or more base classes
89each have inheritable fields the 'base' pragma will croak. See L<fields>
89each have inheritable fields the 'base' pragma will croak. See L<fields>,
90for a description of this feature.
90L<public> and L<protected> for a description of this feature.
9191
9292=end original
9393
9494C<base> はまた、基底クラスのいずれかが持っているフィールドを初期化します。
9595多重継承は対応して B<いません>; 複数の基底クラスがそれぞれ継承可能な
9696フィールドを持っている場合、'base' プラグマは croak します。
97この機能の説明については L<fields> を参照してください。
97この機能の説明については L<fields>, L<public>, L<protected>
98参照してください。
9899
99100=begin original
100101
101102The base class' C<import> method is B<not> called.
102103
103104=end original
104105
105106基底クラスの C<import> メソッドは B<呼び出されません>。
106107
107108=head1 DIAGNOSTICS
108109
109110(診断メッセージ)
110111
111112=over 4
112113
113114=item Base class package "%s" is empty.
114115
115116=begin original
116117
117118base.pm was unable to require the base package, because it was not
118119found in your path.
119120
120121=end original
121122
122123パスに見つからなかったので、base.pm は基底パッケージを
123124require できませんでした。
124125
125126=item Class 'Foo' tried to inherit from itself
126127
127128=begin original
128129
129130Attempting to inherit from yourself generates a warning.
130131
131132=end original
132133
133134自分自身を継承しようとすると警告が出ます。
134135
135 package Foo;
136 use Foo;
136137 use base 'Foo';
137138
138139=back
139140
140141=head1 HISTORY
141142
142143=begin original
143144
144145This module was introduced with Perl 5.004_04.
145146
146147=end original
147148
148149このモジュールは Perl 5.004_04 で導入されました。
149150
150151=head1 CAVEATS
151152
152153(注意)
153154
154155=begin original
155156
156157Due to the limitations of the implementation, you must use
157158base I<before> you declare any of your own fields.
158159
159160=end original
160161
161162実装上の制限により、独自のフィールドを宣言する I<前に>use base しなければなりません。
162163
163164=head1 SEE ALSO
164165
165166L<fields>
166167
167168=begin meta
168169
169170Translate: SHIRAKATA Kentaro <argrath@ub32.org>
170171Status: completed
171172
172173=end meta
173174
174175=cut