Stunt, property definition/removal on anobj parents
0 views
Skip to first unread message
Leviathan-7
unread,
May 24, 2018, 6:12:25 PM5/24/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to MOO Talk
for one, i'm sorry to make a 3rd consecutive post about this stuff.
is there any reason why anobjs are invalidated if you define/remove a property to/from the parent of one? is it at all possible for this not to happen?
Jason SW
unread,
May 24, 2018, 8:08:36 PM5/24/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Leviathan-7, MOO Talk
Apparently this is documented behavior, though the documentation was
hard to find. I hope this can be improved as well, as anonymous objects
would be much more useful without this ... Feature. As it is now, if you
use anonymous objects for an account based login system, or as exits, if
properties get added or removed on the parents, those objects are
permanently lost. Quite annoying.
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to MOO Talk
yeah, a patch to fix this would be an enormous improvement. waifs didn't have this issue though they liked to crash.
Todd Sundsted
unread,
May 25, 2018, 9:18:46 PM5/25/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to MOO Talk
The issue arises from the way properties are laid out in memory for an object (anonymous or permanent). When you add/remove a property to a parent (in Stunt or LambdaMoo) the server visits *every* child and modifies the layout of the properties to account for the change. In order for that to happen, the parent has to maintain a reference to every one of its child objects. I wanted to be able to create 1000's or 10,000s of anonymous objects without a second thought -- parent references to each of these anonymous children would consume an unacceptable amount of memory, not to mention add a tremendous amount of overhead when properties change. The solution is to change the way properties are managed, but that's not a trivial change. Waifs try to fix things up lazily, as waifs are accessed after parents are modified, but it fails to handle tricky edge cases, so I decided to take the simple, but well-defined (if poorly documented) route and just invalidate the children (until a better solution comes up).