|
|
|
|
|
by mklein994
2597 days ago
|
|
The syntax feels a bit Ruby-ish, doesn't it? Here's an example from the article of how they could expand the syntax in the future: foo.bar(..).baz(..).match {
Variant1 => { ... }
Variant2(quux) => { ... }
}
Compared to some Ruby: 5.times {
puts "Hello world!"
}
Note I'm by no means an expert in Ruby or Rust, this is just what I thought of when I saw the syntax. |
|
I prefer Kotlin's general approach of .let and similar:
Now anyone has the general tool for chaining without needing library authors or language designers to create the API for them.