View/Edit #1:property_conflicts

Switch to edit mode.

Name(s): property_conflicts
1:  "object:property_conflicts(newparent)"
2:  "Looks for propertyname conflicts that would keep chparent(object,newparent)"
3:  "  from working."
4:  "Returns a list of elements of the form {<propname>, @<objectlist>}"
5:  "where <objectlist> is list of descendents of object defining <propname>."
6:  {newparent} = args
7:  if (!valid(newparent))
8:    return newparent == #-1 ? {} | raise(E_INVARG)
9:  elseif (!$perm_utils:controls(caller_perms(), this) || !$perm_utils:perm_f(caller_perms(), newparent))
10:   "... if you couldn't chparent anyway, you don't need to know..."
11:   raise(E_PERM, "The prospective parent isn't yours, and it isn't fertile!")
12: endif
13: "... properties existing on newparent"
14: "... cannot be present on object or any descendent..."
15: props = conflicts = {}
16: for o in ({this, @this:descendents_suspended()})
17:   for p in (properties(o))
18:     if (`property_info(newparent, p) ! E_PROPNF => 0')
19:       if (i = p in props)
20:         conflicts[i] = {@conflicts[i], o}
21:       else
22:         props = {@props, p}
23:         conflicts = {@conflicts, {p, o}}
24:       endif
25:     endif
26:     $command_utils:suspend_if_needed()
27:   endfor
28: endfor
29: return conflicts
30: "Last modified by Slacker (#55) on Mon Jun 21 05:46:05 1999 MDT."

Verb arguments: this none this
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Slacker (#55)

You are not logged in.

[home | help | who | search | setup | code]