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

Provide default arguments for Asn1TreeBuilder.() -> Unit #145

Open
ShiinaSekiu opened this issue Sep 30, 2024 · 1 comment
Open

Provide default arguments for Asn1TreeBuilder.() -> Unit #145

ShiinaSekiu opened this issue Sep 30, 2024 · 1 comment

Comments

@ShiinaSekiu
Copy link
Contributor

In some practices we may not use the child node builder.

Asn1.ExplicitlyTagged(34U) { }

fun ExplicitlyTagged(tag: ULong, root: Asn1TreeBuilder.() -> Unit): Asn1ExplicitlyTagged {

Maybe it should be changed to?

fun ExplicitlyTagged(tag: ULong, root: Asn1TreeBuilder.() -> Unit = { }): Asn1ExplicitlyTagged {
@JesusMcCloud
Copy link
Collaborator

Personally, I think the intentions are clearer, if the empty lambda needs to be spelled out. After all you are creating an empty structure. Therefore, I think the code should clearly mirror this intent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants