We need a way to insert several entities from a list. But one of the issues is that statements are supposed to correspond to exactly one entity.
One option is for for loops to expand to a single entity, but spawn several entities within that entity. But I'm not quite sure how to express that in term of syntax. See:
BoxContent(column rules(1.*, 1.2*)) {
BoxSelectedText(style(OptionBoxChoice) text(default_choice_text))
for [size, content] in options_sizes in BoxTicks(row rules(1.3*, 1*)) {
Tick(rules(size, 3px) option_tick(content))
}
}
RArrow(style(OptionBoxRArrow) height(25px))
Maybe it's worthwhile to make an exception for for loops on the one entity rule? If so, this becomes a bit more sensible:
Define a binding so that we can use the query return values
Define a single statement
// rust-like syntax
// We could use <> instead of () in this particular instance
for (foo, bar) in Query((Foo, Bar), With(Baz)) {
FooBarItem(method(foo))
}
// haskell-like syntax
let (foo, bar) = Query<(Foo, Bar), With<Baz>> in FooBarItem(method(foo))
We need a way to insert several entities from a list. But one of the issues is that statements are supposed to correspond to exactly one entity.
One option is for
for
loops to expand to a single entity, but spawn several entities within that entity. But I'm not quite sure how to express that in term of syntax. See:Maybe it's worthwhile to make an exception for
for
loops on the one entity rule? If so, this becomes a bit more sensible:Other options
So what we really want is:
Query
(using a dynamic query)I'll probably go with the rust-like syntax.