Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

Conditionals in lists #713

Answered by myitcv
eonpatapon asked this question in Q&A
Feb 3, 2021 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

I'll leave @mpvl to comment on whether anything like this would ever make sense.

But for now you can:

package x

a: true

l: [
	for _, v in ["foo", "bar"] if a {
		v
	},
	"foobar",
]

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@mpvl
Comment options

Answer selected by myitcv
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants