Post

This idea is getting even closer to "partial/mixed-mode captures" bsky.app/profile/hjvt... Mixing capture modes between the pre-|| keyword and specifiers inside the body feels dirty though, and moves closures further from functions as well.

HJVT@hjvt.dev

I haven't thought about this too hard, but I think explicit captures might have some nice interactions with theoretical partial borrows. In this case it'd could be a "partial capture by clone": move(cx.request_name.clone()) || { foo(cx.request_name); // request_name is a "partial clone" here }

I like this! more of a nit, but does Rust have any other syntax like `keyword(..)`? I can only think of `pub(super/etc.)`, but that tends to be a little further from the actual code

feels too logic-y for my taste imv, it should be a normal keyword without parentheses. (though I’m sure there’s some parsing problem with it that I’m not familiar with lol)

Is there a lot of precedent for keyword(argument) syntax in Rust? I can think of fn(args) but not much else, particularly not in expression space. I’m a bit concerned it won’t stand out as special syntax, and people will read it as a function call

What would that look like when you use a variable twice in a closure? Two `move` calls, or an error suggesting that it can only be moved once?