Skip to content

Commit ec1b6f6

Browse files
authored
breaking syntax change: ??x to x.? (#1095)
See #1023 This also renames Nullable/Maybe to Optional
1 parent d464b25 commit ec1b6f6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+489
-482
lines changed

build.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ pub fn build(b: *Builder) !void {
7575
cxx_compiler,
7676
"-print-file-name=libstdc++.a",
7777
});
78-
const libstdcxx_path = ??mem.split(libstdcxx_path_padded, "\r\n").next();
78+
const libstdcxx_path = mem.split(libstdcxx_path_padded, "\r\n").next().?;
7979
if (mem.eql(u8, libstdcxx_path, "libstdc++.a")) {
8080
warn(
8181
\\Unable to determine path to libstdc++.a

doc/codegen.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Every type has a "handle". If a type is a simple primitive type such as i32 or
66
f64, the handle is "by value", meaning that we pass around the value itself when
77
we refer to a value of that type.
88

9-
If a type is a container, error union, maybe type, slice, or array, then its
9+
If a type is a container, error union, optional type, slice, or array, then its
1010
handle is a pointer, and everywhere we refer to a value of this type we refer to
1111
a pointer.
1212

@@ -19,7 +19,7 @@ Error union types are represented as:
1919
payload: T,
2020
}
2121

22-
Maybe types are represented as:
22+
Optional types are represented as:
2323

2424
struct {
2525
payload: T,
@@ -28,6 +28,6 @@ Maybe types are represented as:
2828

2929
## Data Optimizations
3030

31-
Maybe pointer types are special: the 0x0 pointer value is used to represent a
32-
null pointer. Thus, instead of the struct above, maybe pointer types are
31+
Optional pointer types are special: the 0x0 pointer value is used to represent a
32+
null pointer. Thus, instead of the struct above, optional pointer types are
3333
represented as a `usize` in codegen and the handle is by value.

0 commit comments

Comments
 (0)