-
Originally opened by @tbruyelle in cuelang/cue#937 Hello cue team, I would like to generate definitions from a list: list = [ { name:"def1", args: 1}, {name:"def2", args:2}]
for _,v in list {
"#\(v.name)": {
args: v.args
}
} result:
The problem is the result is not definitions because the names are quoted, what I would like to have is simply:
Is this possible ? |
Beta Was this translation helpful? Give feedback.
Answered by
cueckoo
Jul 3, 2021
Replies: 1 comment 4 replies
-
Original reply by @myitcv in cuelang/cue#937 (comment) You can't currently declare definitions in this way, but you can make them part of an "outer" definition:
|
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
cueckoo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Original reply by @myitcv in cuelang/cue#937 (comment)
You can't currently declare definitions in this way, but you can make them part of an "outer" definition: