2 ms·
Interesting, my lack of real experience in Scheme will make this take a bit more work for me to fully work through the implications of. It's not immediately cle
by saghm 7mo ago
Interesting, my lack of real experience in Scheme will make this take a bit more work for me to fully work through the implications of. It's not immediately clear to what this would mean for Rust, since there is already a loop construct (well, three of them, although two of them are syntactic sugar for the first). You could define a macro around it in Rust today, but it would be fairly uninteresting: https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=38f885d4aca05e6718a57e4e3e9f53ab https://play.rust-lang.org/?version=stable&mode=debug&editio...
- moefh 7mo agoYes, I agree. Like I said, it might be useful when dealing with something that is easier to express in (tail) recursion form instead of an iteration. Anyway, here's something more-or-less equivalent in Rust, which will blow the stack if made to loop too many times: https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=42d597503ef128d8e79cfbb1a466b129 https://play.rust-lang.org/?version=stable&mode=debug&editio... (There may be a way to use a closure instead of a function to avoid hard-coding the type of `$i` in the macro, but I can't find an easy way to write a recursive closure call in Rust).