dummy: fn main syntax! yay

This commit is contained in:
John 2025-09-21 02:58:50 -04:00
parent 8640ec4261
commit 46b17a7eb6

View File

@ -3,9 +3,8 @@
// This is a function. It can be called with the call operator.
// The function called `main` is the program's entrypoint
// fn main() -> (&str, bool, i128)
const main = fn () {
fn main() /*-> (&str, bool, i128)*/ {
// An if expression is like the ternary conditional operator in C
let y = if 10 < 50 {
"\u{1f988}"
@ -34,10 +33,10 @@ const main = fn () {
// desugars to
{
let _pass = || if idx > 2 * 2 { break idx };
let _body = || { 12345 };
let _it = 0..100;
loop if let idx = _it.next() _pass() else _fail()
loop if let idx = _it.next() {
if idx > 2 * 2 { break idx }
} else break { 12345 }
};