Labels for expressions other than loops


#1

Is it possible to apply labels to expressions other than loops? Something like:

'matchFoo: match foo {
     foo_1 => True,
     foo_2 => False
}

#2

If you were able to place that label, how would you use it?


#3

I hadn’t really thought about a use case. Just got curious after using labels with nested loops a few times. I suppose it would be nearly equivalent to closures.

let matchFoo = |foo| -> match foo {
                                   foo_1 => True,
                                   foo_2 => False
                                  }