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

language: make lists open by default #1999

Open
myitcv opened this issue Oct 12, 2022 · 2 comments
Open

language: make lists open by default #1999

myitcv opened this issue Oct 12, 2022 · 2 comments
Labels
pre v1.0 roadmap/language-changes Specific tag for roadmap issue #339

Comments

@myitcv
Copy link
Member

myitcv commented Oct 12, 2022

Structs are open by default, such that:

x: {
    a: 5
}

x: {
    b: 4
}

evaluates to:

x: {
	a: 5
	b: 4
}

The same is currently not true for lists:

y: [3]
y: [_, 4]

evaluates to:

y: incompatible list lengths (1 and 2)

This issue tracks making lists open by default, such that this would not result in an error and instead would result in:

y: [3, 4]

With this change, lists would be closed via the close() builtin, or when referenced via definitions.

See previous discussion at:

@myitcv myitcv added roadmap/language-changes Specific tag for roadmap issue #339 pre v1.0 labels Oct 12, 2022
@mpvl mpvl added this to the v0.6.0 required fields milestone Jan 30, 2023
@verdverm
Copy link

So would I say "a list of 0+ ints"? as nums: [...int]?

What does nums: [int] imply? 0+ ints or 1+ ints?

@myitcv myitcv added the zGarden label Jun 13, 2023
@myitcv
Copy link
Member Author

myitcv commented Jun 14, 2023

Noting down here, that we need to consider how list.Concat could/should behave with respect to arguments that are open/closed, and therefore what the result should be in those situations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pre v1.0 roadmap/language-changes Specific tag for roadmap issue #339
Projects
None yet
Development

No branches or pull requests

3 participants