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

1330: languageguide-propertiesmd⭐️⭐️⭐️⭐️⭐️ #1360

Open
wants to merge 1 commit into
base: swift-6-beta-translation
Choose a base branch
from

Conversation

loshoc
Copy link
Collaborator

@loshoc loshoc commented Aug 17, 2024

complete 1330-language guide-properties

@SwiftSIQI SwiftSIQI linked an issue Sep 19, 2024 that may be closed by this pull request
@yongfrank yongfrank changed the title 1330-languageguide-propertiesmd 1330: languageguide-propertiesmd⭐️⭐️⭐️⭐️⭐️ Sep 22, 2024
@yongfrank
Copy link

@4dmoonlight @bh3236 有空请帮忙 Review Thx!

whereas computed properties calculate (rather than store) a value.
Computed properties are provided by classes, structures, and enumerations.
Stored properties are provided only by classes and structures.
*属性*将值与特定的类、结构或枚举关联。存储属性将常量和变量值作为实例的一部分进行存储,而计算属性则计算(而不是存储)一个值。计算属性由类、结构和枚举提供。存储属性仅由类和结构提供。
Copy link
Collaborator

Choose a reason for hiding this comment

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

属性 -> 属性

Copy link
Collaborator

Choose a reason for hiding this comment

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

中文 改成加粗

@@ -102,38 +77,31 @@ rangeOfThreeItems.firstValue = 6
let length: Int
}
-> var rangeOfThreeItems = FixedLengthRange(firstValue: 0, length: 3)
// the range represents integer values 0, 1, and 2
Copy link
Collaborator

@4dmoonlight 4dmoonlight Sep 23, 2024

Choose a reason for hiding this comment

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

”<!-- “
中的注释不翻译

```

<!--
- test: `storedProperties-err`

```swifttest
-> let rangeOfFourItems = FixedLengthRange(firstValue: 0, length: 4)
// this range represents integer values 0, 1, 2, and 3
// 该区间表示整数 0,1,2,3
Copy link
Collaborator

Choose a reason for hiding this comment

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

同上

This behavior is due to structures being *value types*.
When an instance of a value type is marked as a constant,
so are all of its properties.
这种行为是由于结构体属于*值类型*。当值类型的实例被声明为常量的时候,它的所有属性也就成了常量。
Copy link
Collaborator

Choose a reason for hiding this comment

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

加粗 同上

whereas computed properties calculate (rather than store) a value.
Computed properties are provided by classes, structures, and enumerations.
Stored properties are provided only by classes and structures.
*属性*将值与特定的类、结构或枚举关联。存储属性将常量和变量值作为实例的一部分进行存储,而计算属性则计算(而不是存储)一个值。计算属性由类、结构和枚举提供。存储属性仅由类和结构提供。
Copy link
Collaborator

Choose a reason for hiding this comment

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

结构改为结构体

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Under Review
Development

Successfully merging this pull request may close these issues.

LanguageGuide / properties.md ⭐️⭐️⭐️⭐️⭐️
4 participants