shriram / plai-public

Repository for (for now) filing bug reports about PLAI.
7 stars 0 forks source link

motivation for let bound "private members" could be improved #24

Open bremner opened 11 months ago

bremner commented 11 months ago

Contact Details

bremner@unb.ca

Which part are you commenting on?

p. 89 v3.2.2

What's your suggestion?

By the time the reader reaches this point, the examples already have "private members", since the constructor parameters that we have been mutating are (unless I misunderstand something) also inaccessible outside the class aka constructor function.

Having private members correspond to constructor parameters is not the most general case, and I think the ability to have arbitrary instance variables is a better motivation for the construction introduced in "Private Members".

I guess one could cook up something with e.g. mutable vectors as constructor parameters, but then you would really need to do some kind of copying to make a difference.