News for hackers. Stuff that matters.
Re:Effective Programs: 10 Years of Clojure by simon_o on Tuesday October 31, 2017 @05:53PM (#15596923)
I think the Scala version does exactly what you want it to do, but you seem to be confused about something that I can't really pin-point.

> Why do I need a separate Person and Dog class?

You don't. It's an example.

> Can't a dog have a name as well?

It can.

> Why do I need to declare that upfront or ensure that no other part of code can give a Dog a name?

I have trouble understanding the meaning of that sentence.

There are no comments on this comment yet.