|
|
|
Pattern matching structures
|
|
16 Pattern matching structures
It has been just implemented, so probably it's buggy ;)
switch e {
case {next = {next = null}, data = a}:
return a;
case {next = null, data = a}:
return a + 1;
case _:
return 0;
}
|
|
|
Pattern matching structures
|
|