Skip to content
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

Merged
merged 16 commits into from
Feb 27, 2023
Merged

Conversation

bayashi
Copy link
Contributor

@bayashi bayashi commented Feb 16, 2023

  • Added .gitignore
  • Translation Feature::Compat:Class Class.pod

@bayashi bayashi added the WIP label Feb 16, 2023
@bayashi bayashi removed the WIP label Feb 21, 2023
Copy link
Contributor

@kfly8 kfly8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

おつかれさまです!!!!
訳、むずかしいですね。勉強になりました。

少しコメントさせてもらいました!

docs/modules/Feature-Compat-Class-0.05/Class.pod Outdated Show resolved Hide resolved
docs/modules/Feature-Compat-Class-0.05/Class.pod Outdated Show resolved Hide resolved
docs/modules/Feature-Compat-Class-0.05/Class.pod Outdated Show resolved Hide resolved
=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>.
Copy link
Contributor

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.
}

Copy link
Contributor Author

@bayashi bayashi Feb 26, 2023

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> を使うときは有効です
/

ですかね?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

いったんそのように修正しました

Copy link
Contributor

@kfly8 kfly8 Feb 26, 2023

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を試したところ有効になりませんでした。)

Copy link
Contributor Author

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;してる状態)とすると辻褄があいますかね、という気はしますが、、

Copy link
Contributor

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;してる状態)とすると辻褄があいますかね、という気はしますが、、

あー!辻褄あいますね!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

コアの機能か CObject::Pad を使うときは有効です

元のままでよさそうですね!
お騒がせしました:bow:

Copy link
Contributor

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)

Copy link
Contributor Author

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 からという風に書いてあります。

Copy link
Contributor

@kfly8 kfly8 Feb 27, 2023

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

勉強になります!!

@argrath
Copy link
Contributor

argrath commented Feb 23, 2023

ちなみにコア文書では"attribute"は「属性」と訳しています。

@argrath
Copy link
Contributor

argrath commented Feb 23, 2023

あと、.gitignoreの追加は別件だと思うので、PRも分けた方がいい気がします。

bayashi and others added 3 commits February 26, 2023 08:39
Co-authored-by: kobaken <kfly@cpan.org>
Co-authored-by: kobaken <kfly@cpan.org>
Co-authored-by: kobaken <kfly@cpan.org>
@bayashi
Copy link
Contributor Author

bayashi commented Feb 26, 2023

.gitignore 追加 PR 立てました。
#18

@kfly8
Copy link
Contributor

kfly8 commented Feb 27, 2023

LGTM!

@kfly8 kfly8 merged commit 42e13d0 into master Feb 27, 2023
@kfly8 kfly8 deleted the translation-Feature-Compat-Class branch February 27, 2023 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants