Skip to content

4.29. Casting Between Types #85

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

Merged
merged 3 commits into from
Feb 14, 2016

Conversation

keiichiw
Copy link
Contributor

型間のキャスト(Casting Between Types) の章の翻訳をします。

@keiichiw keiichiw force-pushed the 4_29_casting_between_types branch 2 times, most recently from b76ceea to 68b9127 Compare February 13, 2016 09:31
@keiichiw keiichiw force-pushed the 4_29_casting_between_types branch from 68b9127 to 1aeb62a Compare February 13, 2016 09:59
* `e` has type `*T` and `U` is a numeric type, while `T: Sized`; *ptr-addr-cast*
<!-- * `e` has type `*T`, `U` has type `*U_0`, and either `U_0: Sized` or
`unsize_kind(T) == unsize_kind(U_0)`; a *ptr-ptr-cast* -->
* `e` が型 `*T` を持ち、 `U` が `*U_0` であり、 `U_0: Sized` または `unsize_kind(T) == unsize_kind(U_0)` である場合; *ptr-ptr-cast*
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ptr-ptr-cast の説明で、
原文は、 "U has type U_0" となっているのですが、
U は型を表すメタ変数のはずなので、 「Uが型
U_0を持つ」というのはおかしいと思い、
「Uが*U_0である」と訳しました。
私の理解が正しいならば、英語の方が "U is *U_0" であるべきな気がするのですが、ご意見いただきたいです。

Copy link
Member

Choose a reason for hiding this comment

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

タイブエイリアスの場合なんかもあるのでなんとも、といったところですね。
どちらにしても大きく意味を損なう訳ではないのでこのままで良いと思います。

@keiichiw keiichiw changed the title [WIP] 4.29. Casting Between Types 4.29. Casting Between Types Feb 13, 2016
@keiichiw
Copy link
Contributor Author

翻訳しました。
数箇所、ご意見をいただきたい部分があったので、コメントをつけています。
レビューよろしくお願いします。 @KeenS


A cast `e as U` is valid if `e` has type `T` and `T` *coerces* to `U`.
<!-- A cast `e as U` is valid if `e` has type `T` and `T` *coerces* to `U`. -->
`e as U` というキャストは、 `e` が型 `T` を持ち、かつ `T` が `U` に型強制されるとき、有効です。
Copy link
Member

Choose a reason for hiding this comment

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

[markdown]
T coerces to U.」に出てきている**が抜けているようです。

@KeenS
Copy link
Member

KeenS commented Feb 13, 2016

@kw-udon
相談に返信しました。そのままでいいと思います。
また、何点かコメントしました。確認お願いします。

@keiichiw
Copy link
Contributor Author

@KeenS
ありがとうございます。
コメントを反映しました。
確認よろしくお願いします。

@KeenS
Copy link
Member

KeenS commented Feb 14, 2016

ありがとうございます、マージします。

KeenS added a commit that referenced this pull request Feb 14, 2016
@KeenS KeenS merged commit df32124 into rust-lang-ja:master Feb 14, 2016
@tatsuya6502 tatsuya6502 modified the milestone: 1.6 Apr 28, 2016
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.

3 participants