diff options
author | Jasper Ras <jras@hostnet.nl> | 2025-08-04 08:46:49 +0200 |
---|---|---|
committer | Jasper Ras <jras@hostnet.nl> | 2025-08-04 08:46:49 +0200 |
commit | 00a52e3d631df0a7610f4f17a9bd6d60205239fd (patch) | |
tree | 99aac9c4c78c2ec693d7800a946fd6da7a0ea597 /Statement vs expression.md | |
parent | 931eb0894e7cd3717f1218f0eb06382b11734c13 (diff) |
vault backup: 2025-08-04 08:46:49
Diffstat (limited to 'Statement vs expression.md')
-rw-r--r-- | Statement vs expression.md | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Statement vs expression.md b/Statement vs expression.md new file mode 100644 index 0000000..e899857 --- /dev/null +++ b/Statement vs expression.md @@ -0,0 +1,9 @@ +[[Rust]] +[[A scope block is an expression]] +[[How to return from a function]] +[[Adding a semicolon to the end of a line turns it into a statement]] +[[It is not possible to do a chain assignment]] +[[An empty tuple is called a unit]] + +An expression returns something, ie `1 + 2` returns `3`. +A statement on the other hand does not return anything: as assignment is a statement. It equals to the unit!
\ No newline at end of file |