diff --git a/learn/advanced/package_management.md b/learn/advanced/package_management.md index a9272140..4231a26b 100644 --- a/learn/advanced/package_management.md +++ b/learn/advanced/package_management.md @@ -162,4 +162,4 @@ fn anonymousDependency(b: *Build, relative_build_root: []const u8, comptime buil ::: -TODO:更多示例说明 \ No newline at end of file +TODO:更多示例说明 diff --git a/learn/more/reflection.md b/learn/more/reflection.md index 0a54b159..e6f519b8 100644 --- a/learn/more/reflection.md +++ b/learn/more/reflection.md @@ -142,7 +142,7 @@ const Foo = struct { pub fn main() !void { // true std.debug.print("blah:{}\n", .{@hasDecl(Foo, "blah")}); - // true + // true // hi 此声明可以被检测到是因为类型和代码处于同一个文件中,这导致他们之间可以互相访问 // 换另一个文件就不行了 std.debug.print("hi:{}\n", .{@hasDecl(Foo, "hi")}); @@ -214,7 +214,6 @@ pub fn main() !void { ::: - ### `@fieldParentPtr` [`@fieldParentPtr`](https://ziglang.org/documentation/master/#fieldParentPtr) 根据给定的指向结构体字段的指针和名字,可以获取结构体的基指针。 @@ -236,8 +235,6 @@ pub fn main() !void { } ``` - - ### `@call` [`@call`](https://ziglang.org/documentation/master/#call) 调用一个函数,和普通的函数调用方式相同。