Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API

From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
I actually can't write a macro that does this right, because a macro can't enumerate the bindings of a subexpression let alone whether they should be mutable. I can write a macro that accepts the list of bindings, but then it would make more sense to declare for each of them whether the function needs to bind them _and_ whether the async block does.
-
lorentz1516624h@12bitfloat if you want a type-erased async multiple-call lambda, you need to
- box the future for type erasure
- box the lambda for type erasure
- clone any bindings to ensure that the future doesn't borrow from the lambda because now you can't use AsyncFn. -
lorentz1516624h@12bitfloat mind, all of those qualifiers refer to the general case. Statically knowing the type of a lambda, needing to only call it once, and having it resolve synchronously are all lucky special cases as far as problem spaces go.
-
12bitfloat1025523h@lorentz Ah I think I understand now
Yeah that's the beauty of the extremely efficient async implementation in Rust. It's a challenge of who dies first: You or the compiler :P -
kobenz87120h@lorentz, I would suggest writing a bigger macro that walks its input, expanding smaller macros inside its input in the way you want. But you'll need this
https://docs.rs/quote/latest/quote or else you'll go insane -
lorentz1516616h@kobenz Is it possible to expand a macro inside a macro? I didn't know that's a thing in Rust.
-
chatgpt59714h@Lensflare
Rust, boxes, moving, and the future can be connected in various ways:
1. **Rust** symbolizes decay and deterioration over time. In the context of moving, rust on boxes or furniture may suggest neglect or lack of care in maintaining possessions. As one prepares to move to a new place, dealing with rust could serve as a reminder to clean, repair, or replace items before embarking on the new chapter.
2. **Boxes** are essential for moving, as they are used to pack belongings and transport them to a new location. They represent the physical aspect of transitioning to a new space. Boxes can also symbolize new beginnings and the need to organize and prioritize possessions before moving forward. They hold memories of the past and hopes for the future.
3. **Moving** signifies a significant change or transition from one place to another, often bringing uncertainty and excitement for what lies ahead. It involves leaving behind the familiar and embracing the unknown. Moving can be a -
chatgpt59714hmetaphor for personal growth, adaptability, and the willingness to step out of one's comfort zone to pursue new opportunities.
4. **The future** represents the unknown and potential outcomes that await us. It is the destination towards which we move, carrying our past experiences and present choices with us. The future is shaped by our actions in the present and our ability to adapt to change. Rust, boxes, and moving all play a role in preparing us for the future by forcing us to assess our belongings, let go of the old, and embrace new possibilities.
Overall, rust, boxes, moving, and the future are interconnected themes that highlight the cyclical nature of life, growth, and change. They urge us to reflect on the past, make necessary adjustments in the present, and look forward to what the future may hold.
Related Rants
Async Rust
rant
box-dyn
move
async
box-future
rust