From 95eb711ca8c0843ede117f61025c5eda0102f845 Mon Sep 17 00:00:00 2001 From: Dave Gauer Date: Fri, 12 Mar 2021 20:10:55 -0500 Subject: [PATCH] langref: Use "single-item pointer" and "many-item pointer" (#8217) These terms give short, descriptive names for the two pointer types which reflect the names used in src/type.zig. --- doc/langref.html.in | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/doc/langref.html.in b/doc/langref.html.in index 645c03dcbb..aca09c55fe 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -684,7 +684,7 @@ pub fn main() void { {#header_close#} {#header_open|String Literals and Unicode Code Point Literals#}

- String literals are single-item constant {#link|Pointers#} to null-terminated byte arrays. + String literals are constant single-item {#link|Pointers#} to null-terminated byte arrays. The type of string literals encodes both the length, and the fact that they are null-terminated, and thus they can be {#link|coerced|Type Coercion#} to both {#link|Slices#} and {#link|Null-Terminated Pointers|Sentinel-Terminated Pointers#}. @@ -1783,7 +1783,7 @@ comptime { expect(message.len == 5); } -// A string literal is a pointer to an array literal. +// A string literal is a single-item pointer to an array literal. const same_message = "hello"; comptime { @@ -1989,15 +1989,15 @@ test "null terminated array" { {#header_open|Pointers#}

- Zig has two kinds of pointers: + Zig has two kinds of pointers: single-item and many-item.