Files

12 lines
370 B
Plaintext
Raw Permalink Normal View History

2026-10-26 10:14:11 -05:00
import std::io;
struct noisy : owning { var id: int; }
def noisy::close(&mut this): void { if this.id != 0 { println($"closing {this.id}"); } }
def take<Ts...>(xs: Ts...): void { println($"took {xs.length}"); }
def pass<Ts...>(xs: Ts...): void {
take(...xs);
println("passed");
}
def main(): void {
pass(noisy{ id = 1 }, noisy{ id = 2 }, 3);
println("done");
}