News for hackers. Stuff that matters.
Re:Algebraic Data Types for C99 by brabel on Thursday May 09, 2024 @01:32PM (#40310620)
Java 21's pattern matching (you don't need functionaljava, and shouldn't really use that unless you're really into FP) is kind of nicer than Kotlin's, because you can automatically "destruct" records in your matches.

For Java, see https://www.baeldung.com/java-lts-21-new-features

Kotlin's: https://www.baeldung.com/kotlin/when

Make up your own mind.

Re:Algebraic Data Types for C99 by ackfoobar on Friday May 10, 2024 @01:00AM (#40315618)
> kind of nicer than Kotlin's, because you can automatically "destruct" records in your matches.

I find positional destructuring of records a bad idea.

https://news.ycombinator.com/item?id=31399737