4 ms·
Appears similar to Scala w/ case classes, but I wish it was more vague and used extractors similar to Scala's unapply. It would make it much more amenable to ex
by kodablah 12y ago
Appears similar to Scala w/ case classes, but I wish it was more vague and used extractors similar to Scala's unapply. It would make it much more amenable to existing classes.
- Locke1689 12y agoOne thing we could do here is expand the definition of extension methods to include extension operators. I think this makes sense for other reasons. If we do that, you could provide pattern matching for existing classes, even ones from metadata, by simply manually specifying an extension is-operator for the class.
- virtualwhys 12y ago> Appears similar to Scala w/ case classes Similar? Looks exactly the same to me (language syntax aside), immutable properties, hashcode, equals, toString, etc. Kotlin grabbed it as well for their record types, good idea, eliminates great swaths of boilerplate and mutable state at the same time.