Update Examples
parent
18aec049a5
commit
45e7b32a79
11
Examples.md
11
Examples.md
@ -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.)
|
||||
|
||||
### Hello World
|
||||
<table>
|
||||
<tr>
|
||||
<th>Rust</th>
|
||||
<th>Husht</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
```
|
||||
// Many comments from the Rust by Example version have been removed
|
||||
fn main() {
|
||||
@ -8,14 +15,14 @@ fn main() {
|
||||
println!("Hello World!");
|
||||
}
|
||||
```
|
||||
<->
|
||||
</td><td>
|
||||
```
|
||||
// Many comments from the Rust by Example version have been removed
|
||||
fn main
|
||||
// Print text to the console.
|
||||
println! "Hello World!"
|
||||
```
|
||||
|
||||
</td></tr></table>
|
||||
#### Formatted print
|
||||
(Skipping for now because we likely want "f-strings" in Husht, which require some thought/design.)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user