// winded in the shower, almost gasping.. wtf, why !? // drink last night ? release last night ? lack of sleep ? // 2024-09-11 // functions var main = { fn( argc :usize, argv :[:null]const[:0]const u8 ) :void; debug( "hello world\n", .{} ); }; var min = { fn( a :infer T, b :T ):T ; { if( a < b ); return a; else; return b; }; }; var min2 = { fn( a :$T, b :T ):T ; { if( a < b ); a else; b } }; // loops { init // problem is state of initialized vars while( cond ) more } { // normal while while( cond ) body } { // do while body while( cond ) } { // a, 0, a, 1, a, 2, a. log( 'a' ); for( 0..3 ) |i|; log( i ); } // conditional { if( cond ) alpha beta elif( cond ) zeta eta theta else omega } // mixes var mut i = 0; { // log( "b{i}" ); while( i < 3 ); if( rand( bool ) ) break 5; else; log( "a{i}" ); end; 7; } // switch { switch( var ) case 1; handle( 1 ); case 2, 3 | v2; log() handle2and3( v2 ) default ; log( not 1 2 3 ) } // 2024-09-17 label: { if( rand() ) { break :label; }; // forward if( rand() ) { continue :label; }; // backward }