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

Well, => is not really an operator in ooc, but it could be made overloadable. The solution @fredreichbier suggests is even simpler and doesn't require any overloading, though, using only commas, e.g.

```ooc
a := HashMap new(
"key", "value",
"yay", "ho"
)
```

That said, if we *did* make => overloadable we could make something like

```ooc
Pair: class {
k: K
v: V

init: func (=k, =v) {}
}

map: func (pairs: Pair...) {
h := HashMap new()
pairs each(|p| h add(p k, p v))
}
```

Which could then be used like this (with a little extra inference):

```ooc
hm := map("food" => "bacon", "drinks" => "beer")
```

That's the kind of code I wouldn't mind writing (: Doesn't sound overly complex on the sdk side, might be more of a challenge to actually implement it.