argra****@users*****
argra****@users*****
2018年 7月 27日 (金) 23:41:46 JST
Index: docs/perl/5.20.1/perlguts.pod diff -u docs/perl/5.20.1/perlguts.pod:1.2 docs/perl/5.20.1/perlguts.pod:1.3 --- docs/perl/5.20.1/perlguts.pod:1.2 Sun Jan 11 17:45:51 2015 +++ docs/perl/5.20.1/perlguts.pod Fri Jul 27 23:41:46 2018 @@ -743,11 +743,10 @@ 効率性はちょっとしたハックによるものです: 実際に文字を削除する代わりに、 C<sv_chop> は、他の関数にオフセットハックが有効であることを示す C<OOK> (offset OK) フラグを設定して、 -and it moves the PV pointer (called C<SvPVX>) forward -by the number of bytes chopped off, and adjusts C<SvCUR> and C<SvLEN> -accordingly. (A portion of the space between the old and new PV -pointers is used to store the count of chopped bytes.) -(TBT) +切り落としたバイト数だけ (C<SvPVX> と呼ばれる) PV ポインタを前に進め、 +C<SvCUR> と C<SvLEN> をそれぞれ調整します。 +(新旧の PV ポインタの間のスペースの部分は、切り落としたバイト数を +保管するために使われます。) =begin original @@ -1424,10 +1423,8 @@ 印として C<&PL_sv_undef> を使います。 従って、上述の Perl コードは C<exists $av[0]> は真ですが、 XS コードによって生成された配列では偽です。 -In perl 5.20, storing -&PL_sv_undef will create a read-only element, because the scalar -&PL_sv_undef itself is stored, not a copy. -(TBT) +perl 5.20 では、&PL_sv_undef を保管すると読み込み専用要素が作られます; +コピーではなく &PL_sv_undef 自体が保管されるからです。 =begin original @@ -2346,11 +2343,11 @@ =end original -In Perl 5.16 and earlier, copy-on-write (see the next section) shared a -flag bit with read-only scalars. So the only way to test whether -C<sv_setsv>, etc., will raise a "Modification of a read-only value" error -in those versions is: -(TBT) +Perl 5.16 以前では、コピーオンライト (次章参照) は読み込み専用スカラと +フラグビットを共有していました。 +従って、これらのバージョンで C<sv_setsv> などが +"Modification of a read-only value" エラーを発生させるかどうかを +テストする唯一の方法は次のようなものです: SvREADONLY(sv) && !SvIsCOW(sv) @@ -2362,10 +2359,10 @@ =end original -Under Perl 5.18 and later, SvREADONLY only applies to read-only variables, -and, under 5.20, copy-on-write scalars can also be read-only, so the above -check is incorrect. You just want: -(TBT) +Perl 5.18 以降では、SvREADONLY は読み込み専用変数にのみ適用され、 +5.20 では、コピーオンライトスカラもまた読み込み専用なので、 +前述のチェックは正しくありません。 +単に次のようにしてください: SvREADONLY(sv) @@ -2375,8 +2372,8 @@ =end original -If you need to do this check often, define your own macro like this: -(TBT) +これをチェックをしょっちゅう行う必要がある場合、次のようにして +独自のマクロをチェックしてください: #if PERL_VERSION >= 18 # define SvTRULYREADONLY(sv) SvREADONLY(sv) @@ -4207,14 +4204,16 @@ スクラッチパッドはカレントユニットのためのレキシカルやオペコードのための target である SV を保持します。 -この文書の以前の盤では、SV があるスクラッチパッドを、SV のフラグを +この文書の以前の版では、SV があるスクラッチパッドを、SV のフラグを 見ることによって推測することができると書いていました: レキシカルでは -C<SVs_PADMY> されていて、I<target> では C<SVs_PADTMP> がセットされています。 -But this have never been fully true. -C<SVs_PADMY> could be set on a variable that no longer resides in any pad. -While I<target>s do have C<SVs_PADTMP> set, it can also be set on variables -that have never resided in a pad, but nonetheless act like I<target>s. -(TBT) +C<SVs_PADMY> が設定されていて、I<target> では C<SVs_PADTMP> が +設定されています。 +しかしこれは決して完全に真ではありません。 +C<SVs_PADMY> はもはやどのパッドにも存在しない変数に +セットされることがあります。 +I<target> は C<SVs_PADTMP> が設定されている一方、 +どのパッドにも存在しない変数に設定されることもありますが、 +それでも I<target> のように振る舞います。 =begin original @@ -6619,11 +6618,10 @@ これがない場合は、バイトの値が符号位置で、逆も成り立ちます (言い換えると、 文字列は iso-8859-1 としてエンコードされますが、iso-8859-1 の意味論を 使うには C<use feature 'unicode_strings'> が必要です)。 -This flag is only meaningful if the SV is C<SvPOK> -or immediately after stringification via C<SvPV> or a similar -macro. +このフラグは、 +SV が C<SvPOK> であるか、C<SvPV> や同様のマクロによる文字列化の直後でのみ +意味があります。 以下のマクロでこのフラグのチェックと操作ができます: -(TBT) SvUTF8(sv) SvUTF8_on(sv)