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

Repeat arguments #42

Draft
wants to merge 14 commits into
base: develop
Choose a base branch
from
Draft

Repeat arguments #42

wants to merge 14 commits into from

Conversation

Tamschi
Copy link
Owner

@Tamschi Tamschi commented Feb 14, 2021

(This waits on me completing idanarye/rust-typed-builder#46.)


This feature allows adding * and + to constructor and render argument definitions so that

asteracea::component! {
	Any(
		pub sometimes*?: usize,
		pub some/many+?: usize,
		pub one/any*: usize,
		pub always+: usize,
	)()

	new with {
		let _: &Option<Vec<usize>> = &sometimes;
		let _: &Option<Vec1<usize>> = &many;
		let _: &Vec<usize> = &any;
		let _: &Vec1<usize> = &always;
	}

	[]
}

is legal.


Open Questions

  • Should *? imply Option<Vec<…>> or just Vec<…>?

@Tamschi Tamschi added type: feature Brand new functionality, features, pages, workflows, endpoints, etc. blocked This waits on some other issue, either in this repository or elsewhere labels Feb 14, 2021
@Tamschi Tamschi self-assigned this Feb 14, 2021
@Tamschi Tamschi marked this pull request as draft February 14, 2021 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked This waits on some other issue, either in this repository or elsewhere type: feature Brand new functionality, features, pages, workflows, endpoints, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant