From 9273c2ca8c386a3ce4f532e1f65436fabf5bd1aa Mon Sep 17 00:00:00 2001 From: jinzhongjia Date: Mon, 1 Jan 2024 18:48:17 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=86=85=E5=BB=BA=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E8=AE=B2=E8=A7=A3=E7=AB=A0=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- learn/.vitepress/sidebar.ts | 8 ++++---- learn/basic/basic_type/function.md | 8 ++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/learn/.vitepress/sidebar.ts b/learn/.vitepress/sidebar.ts index 34dc5d99..eee22fd2 100644 --- a/learn/.vitepress/sidebar.ts +++ b/learn/.vitepress/sidebar.ts @@ -201,10 +201,10 @@ export default [ text: "未定义行为", link: "/more/undefined_behavior", }, - { - text: "内建函数", - link: "/more/builtin_func", - }, + // { + // text: "内建函数", + // link: "/more/builtin_func", + // }, { text: "风格指南", link: "/more/style_guide", diff --git a/learn/basic/basic_type/function.md b/learn/basic/basic_type/function.md index 95d78f8b..5ed3f6e4 100644 --- a/learn/basic/basic_type/function.md +++ b/learn/basic/basic_type/function.md @@ -74,6 +74,14 @@ zig 在这方面的处理则是,原始类型(整型、布尔这种)传递 ::: +## 内建函数 + +内建函数由编译器提供,并以 `@` 为前缀。参数上的 `comptime` 关键字意味着该参数必须在编译期已知。 + +介于内建函数的数目过多,故不进行系统讲解,仅在对应章节说明涉及到的内建函数。 + +更多的内建函数文档请看 [这里](https://ziglang.org/documentation/master/#Builtin-Functions)。 + ## 高阶使用 ### `anytype`