Update Examples

Glen Whitney 2024-08-21 17:11:29 +00:00
parent 18aec049a5
commit 45e7b32a79

@ -1,6 +1,13 @@
This page selects some example programs from "Rust by Example" and shows their intended Husht equivalents. (Of course, the details of the syntax on the Husht side may vary.) This page selects some example programs from "Rust by Example" and shows their intended Husht equivalents. (Of course, the details of the syntax on the Husht side may vary.)
### Hello World ### Hello World
<table>
<tr>
<th>Rust</th>
<th>Husht</th>
</tr>
<tr>
<td>
``` ```
// Many comments from the Rust by Example version have been removed // Many comments from the Rust by Example version have been removed
fn main() { fn main() {
@ -8,14 +15,14 @@ fn main() {
println!("Hello World!"); println!("Hello World!");
} }
``` ```
<-> </td><td>
``` ```
// Many comments from the Rust by Example version have been removed // Many comments from the Rust by Example version have been removed
fn main fn main
// Print text to the console. // Print text to the console.
println! "Hello World!" println! "Hello World!"
``` ```
</td></tr></table>
#### Formatted print #### Formatted print
(Skipping for now because we likely want "f-strings" in Husht, which require some thought/design.) (Skipping for now because we likely want "f-strings" in Husht, which require some thought/design.)