libera/#commonlisp - IRC Chatlog
Search
19:08:50
alcor
_death: change-class just changes the class, it doesn't touch the state (or rather, it delegates that to update-instance-for-different-class)
19:09:19
alcor
_death: "change-all-references" has at least simpler semantics. It does what it says.
19:09:31
_death
alcor: what you maybe meaning to say is that it may touch the state (via u-i-f-d-c) but not identity
19:11:27
alcor
_death: Kind of. State handling with change-class harbors a few footguns that don't exist with the nuclear approach that is reference patching
19:17:10
alcor
_death: To quote the CLHS: "If in the old class there is any slot of the same name as a local slot in the new-class, the value of that slot is retained"
19:20:00
_death
that just sounds like part of the protocol.. granted if a programmer didn't expect it to happen, may have footache, but doesn't that mean that anything can serve as a footgun?
19:26:03
alcor
It makes naming collisions hurt, but admittedly I don't know how a better solution could look like (perhaps raising a condition?)
19:27:47
alcor
The issue is that it's subtle and causes no explicit error. It's one of these things that can create difficult-to-debug issues.
19:27:58
_death
but I agree that change-class (that requires an instance evolution protocol) is more elaborate
20:30:22
pve
I was wondering the other day if "become:" can be simulated in CL somehow, but it probably can't, right?
6:57:51
minion
memo for pve - any link to this Smalltalk-in-Lisp: I can't be expected to work when CLiki doesn't respond to me, can I?