nddrylliog/rock — comment on commit 019798b25843bfedcc6fb7929d6e8e7cbf0c8946
File:  line 0
By fredreichbier:

@nddrylliog I actually intended it similarly to array literals. Correct me if I'm wrong ;-)

```ooc
// in structs/ArrayList, we have:
operator as (array: T[]) -> ArrayList { ArrayList new(array data, array length) }
// which is used to transform
a := ["a", "b"] as ArrayList
// to a call like
a := __OP_CAST_Array_ArrayList(["a", "b"], 2)
// (or something like that)
```
Similarly, we could use:

```ooc
operator as (args: ...) -> HashBag {
bag := HashBag new()
args each(|arg| /* ... */)
bag
}
// to transform
a := ["a" => "b", "c" => "d"] as HashBag
// to
a := __OP_CAST_Vararg_HashBag("a", "b", "c", "d")
```

Haha, now that I wrote that out, it looks kind of ugly. But something like that (involving varargs) would allow us to make Bag literals. Hmm.