From 048fa6c9cf9b9d0926db42932185e5f5e246f276 Mon Sep 17 00:00:00 2001 From: David Gonzalez Martin Date: Thu, 6 Jun 2024 12:21:41 -0600 Subject: [PATCH] Extra fixes --- content/nativity/_index.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/content/nativity/_index.md b/content/nativity/_index.md index 8eb5ce0..0b9afc1 100644 --- a/content/nativity/_index.md +++ b/content/nativity/_index.md @@ -62,6 +62,8 @@ fn [cc(.c)] main [export] () s32 { ## Conditionals +Here is how conditionals work, both with integers (which act as booleans) and pointers: + ```nat {filename="main.nat"} module std; @@ -77,9 +79,12 @@ fn [cc(.c)] main [export] () s32 { // With pointers >pointer: ?*u32 = a.&; if (?pointer) { - // Here the variable is shadowed, the attribute "non-null" is added to the backend to the pointer variable + // Here the variable is shadowed for this scope. + // The attribute "non-null" is added to the backend to the pointer variable } else { // Here the pointer is null } + + return 0; } ```