Files
l-language/test/programs/40_multi_ret.l
T
Serendipity 71208a87f4 feat: 多返回值 fn f(...) -> (T, U) { return (e1, e2); }
Parser: -> (T1,T2) 解析为隐式 struct __ret_funcname, return (e1,e2) 去糖为 struct init
返回的 struct 可访问字段 _0, _1, ... 无 sema/codegen 改动

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-07 14:07:13 +08:00

11 lines
205 B
Common Lisp

fn div_mod(a: i64, b: i64) -> (i64, i64) {
return (a / b, a % b);
}
fn main() -> i64 {
let result = div_mod(10, 3);
print_i64(result._0); // 3
print_i64(result._1); // 1
return 0;
}