-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translation Feature::Compat:Class #16
Conversation
bayashi
commented
Feb 16, 2023
- Added .gitignore
- Translation Feature::Compat:Class Class.pod
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
おつかれさまです!!!!
訳、むずかしいですね。勉強になりました。
少しコメントさせてもらいました!
=begin original | ||
|
||
Note that C<class> blocks B<do not> implicitly enable the C<strict> and | ||
C<warnings> pragmata; either when using the core feature or C<Object::Pad>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using the core feature
ここのthe core featureが指すものは、class featureかと思ったのですが、違いますかね・・?
試しにclass featureを有効にした時に、strict/warningsが有効になるかと思って試したのですが、
そうではないみたいでして。
# perl 5.37.9
use experimental qw(class);
class Foo {
print $a + 1;
}
ちなむと、Object::Padの場合は有効になっていました。
use Object::Pad;
class Foo {
print $a + 1;
# => Use of uninitialized value $Foo::a in addition (+) at foo.pl line 4.
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/
コアの機能か C<Object::Pad> を使うときは有効です
/
C<class>feature を取り込んだ時か、 C<Object::Pad> を使うときは有効です
/
ですかね?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
いったんそのように修正しました
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
わかりにくくてすいません!
- コアの機能か
C<Object::Pad>
を使うときは有効です - Cfeature を取り込んだ時か、 CObject::Pad を使うときは有効です
和訳はこのどちらも良さそうです。
ですが、Cfeatureで試したところ、この意図通り動かなかった感じです。
より冗長に書くなら、こんな感じにするのはいかがでしょうか?
C<class>feature を取り込んだ時か、 C<Object::Pad> を使うときは有効です(訳注:perl5.37.9で<class>featureを試したところ有効になりませんでした。)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
あーたしかに。
ここのthe core featureが指すものは、class featureかと
コアの strict/warnings を指してる(明示的に use warnings; use strict;してる状態)とすると辻褄があいますかね、という気はしますが、、
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
コアの strict/warnings を指してる(明示的に use warnings; use strict;してる状態)とすると辻褄があいますかね、という気はしますが、、
あー!辻褄あいますね!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
コアの機能か CObject::Pad を使うときは有効です
元のままでよさそうですね!
お騒がせしました:bow:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
コードを試した結果としては
class feature -> strict/warnings 有効にならない
Object::Pad -> strict/warnings 有効になる
でしたー。
#16 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
取り急ぎ実際の動作から the core feature
は perl本体の use strict / use warnings のことだという前提で訳文としては直訳しておいて、pragmaの挙動について補足を書いておきました。
use VERSION したときに strict/warnings両方オンになるのって36からなんですっけ。strictはもうちょっと前からオンのような気がしますが、warningsとはセットではなかったんでしたっけ。perlのポリシーからしてセットではない気がしますが、ちょっと知らないところだったので原文頼りでuse v.536 からという風に書いてあります。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
waringsも有効になったのは、v5.36からですね!
|
||
=item Fields in later field expressions | ||
|
||
=begin original |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
勉強になります!!
ちなみにコア文書では"attribute"は「属性」と訳しています。 |
あと、.gitignoreの追加は別件だと思うので、PRも分けた方がいい気がします。 |
Co-authored-by: kobaken <kfly@cpan.org>
Co-authored-by: kobaken <kfly@cpan.org>
Co-authored-by: kobaken <kfly@cpan.org>
.gitignore 追加 PR 立てました。 |
LGTM! |