Skip to content
This repository has been archived by the owner on Aug 24, 2024. It is now read-only.

Commit

Permalink
Update 04-style-guide.md (#25)
Browse files Browse the repository at this point in the history
另外,最后两段内容相同,行文类似,应该是重复了。
不知是否另有目的,所以没改动,在这里提及。
  • Loading branch information
hshq authored Jan 3, 2024
1 parent eff6ca5 commit c352730
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 04-style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ std.debug.print("{any}\n", .{@TypeOf(.{.year = 2023, .month = 8})});
我们已经看到过一些内置函数:`@import``@rem``@intCast`。因为这些都是函数,他们的命名遵循驼峰命名法。`@TypeOf`也是一个内置函数,但是他遵循 PascalCase,为何?因为他返回的是一个类型,因此它的命名采用了类型命名方法。当我们使用一个变量,去接收`@TypeOf`的返回值,这个变量也需要遵循类型命名规则(即 PascalCase):

```
const T = @TypeOf(3)
const T = @TypeOf(3);
std.debug.print("{any}\n", .{T});
```

Expand Down

0 comments on commit c352730

Please sign in to comment.