Skip to content

Instantly share code, notes, and snippets.

@youxkei
Created July 13, 2024 17:27
Show Gist options
  • Save youxkei/d0d35639c8c491b81e3fb65ba78f29e1 to your computer and use it in GitHub Desktop.
Save youxkei/d0d35639c8c491b81e3fb65ba78f29e1 to your computer and use it in GitHub Desktop.
import "list"
#floors: {
for i in list.Range(0, 1000, 1) {
"floor\(i)": {
for j in list.Range(i, i+100, 1) {
"\(j)": string
}
}
}
}
#floors: [name=_]: _tag: "floors_\(name)"
#Floor: {
_tag: or([for f in #floors { f._tag }])
for f in #floors {
if f._tag == _tag {
for k, v in f {
(k): v
}
}
}
}
result: #Floor & #floors.floor5 & { "10": 1 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment