Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalise constructor blocks into inline block expressions #102

Open
Tamschi opened this issue Feb 28, 2022 · 0 comments
Open

Generalise constructor blocks into inline block expressions #102

Tamschi opened this issue Feb 28, 2022 · 0 comments
Labels
domain: Rust Involves Rust code. priority: someday If you need this, please let me know! state: question Further information is requested type: feature Brand new functionality, features, pages, workflows, endpoints, etc. work: novel There's a problem, and both goal and solution are unclear.

Comments

@Tamschi
Copy link
Owner

Tamschi commented Feb 28, 2022

Currently, a special constructor like the following is available once:

new with {
    let _ = local_resource_node.borrow();
}

This is not ideal, as it is rarely-used special syntax and unlike with { … } … expressions can not be used arbitrarily on subexpressions.

A possible change would be to to generalise and unify these blocks and expressions into *inline "Rust" { … } … and .inline "Rust" { … } … expressions, for the constructor and render scope respectively. The constructor-scoped inline blocks should support dependency injection in a scoped manner (though how to make this flow nicely to content children is an unsolved problem. It may still be more clear to still require using additional, transparent container components for this purpose).

Iff scoped dependency injection is allowed in some way in the future, the branch-on-borrow handle should be renamed from local_resource_node to scoped_resource_node.

@Tamschi Tamschi added type: feature Brand new functionality, features, pages, workflows, endpoints, etc. state: question Further information is requested domain: Rust Involves Rust code. priority: someday If you need this, please let me know! work: novel There's a problem, and both goal and solution are unclear. labels Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: Rust Involves Rust code. priority: someday If you need this, please let me know! state: question Further information is requested type: feature Brand new functionality, features, pages, workflows, endpoints, etc. work: novel There's a problem, and both goal and solution are unclear.
Projects
Design considerations
Awaiting triage
Development

No branches or pull requests

1 participant