Just wrote my first DSL in kotlin. I’m a little sa...
# announcements
p
Just wrote my first DSL in kotlin. I’m a little sad that the resulting object cannot be immutable.
a
YES, this. What you can do though is treat DSL as a neat builder and then actually have
.build()
etc
Which will return immutable data class
p
consider a html DSL, every object must have a immutable representation. I implemented this but it requires so much code.
a
I know right 😞
v
you could have setters that produce a new immutable state instead of modifying the current one