/
html/
<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.51
     from ProgrammersManual.texinfo on 4 March 1997 -->

<TITLE>LambdaMOO Programmer's Manual - Movement</TITLE>
</HEAD>
<BODY>
Go to the <A HREF="ProgrammersManual_1.html">first</A>, <A HREF="ProgrammersManual_47.html">previous</A>, <A HREF="ProgrammersManual_49.html">next</A>, <A HREF="ProgrammersManual_77.html">last</A> section, <A HREF="ProgrammersManual_toc.html">table of contents</A>.
<P><HR><P>


<H4><A NAME="SEC48" HREF="ProgrammersManual_toc.html#TOC48">Object Movement</A></H4>

<P>
<DL>
<DT><U>Function:</U> none <B>move</B> <I>(obj <VAR>what</VAR>, obj <VAR>where</VAR>)</I>
<DD><A NAME="IDX62"></A>
Changes <VAR>what</VAR>'s location to be <VAR>where</VAR>.  This is a complex process
because a number of permissions checks and notifications must be performed.
The actual movement takes place as described in the following paragraphs.

</P>
<P>
<VAR>what</VAR> should be a valid object and <VAR>where</VAR> should be either a valid
object or <CODE>#-1</CODE> (denoting a location of `nowhere'); otherwise
<CODE>E_INVARG</CODE> is raised.  The programmer must be either the owner of
<VAR>what</VAR> or a wizard; otherwise, <CODE>E_PERM</CODE> is raised.

</P>
<P>
If <VAR>where</VAR> is a valid object, then the verb-call

</P>

<PRE>
<VAR>where</VAR>:accept(<VAR>what</VAR>)
</PRE>

<P>
is performed before any movement takes place.  If the verb returns a
false value and the programmer is not a wizard, then <VAR>where</VAR> is
considered to have refused entrance to <VAR>what</VAR>; <CODE>move()</CODE> raises
<CODE>E_NACC</CODE>.  If <VAR>where</VAR> does not define an <CODE>accept</CODE> verb, then it
is treated as if it defined one that always returned false.

</P>
<P>
If moving <VAR>what</VAR> into <VAR>where</VAR> would create a loop in the containment
hierarchy (i.e., <VAR>what</VAR> would contain itself, even indirectly), then
<CODE>E_RECMOVE</CODE> is raised instead.

</P>
<P>
The <SAMP>`location'</SAMP> property of <VAR>what</VAR> is changed to be <VAR>where</VAR>, and
the <SAMP>`contents'</SAMP> properties of the old and new locations are modified
appropriately.  Let <VAR>old-where</VAR> be the location of <VAR>what</VAR> before it was
moved.  If <VAR>old-where</VAR> is a valid object, then the verb-call

</P>

<PRE>
<VAR>old-where</VAR>:exitfunc(<VAR>what</VAR>)
</PRE>

<P>
is performed and its result is ignored; it is not an error if <VAR>old-where</VAR>
does not define a verb named <SAMP>`exitfunc'</SAMP>.  Finally, if <VAR>where</VAR> and
<VAR>what</VAR> are still valid objects, and <VAR>where</VAR> is still the location of
<VAR>what</VAR>, then the verb-call

</P>

<PRE>
<VAR>where</VAR>:enterfunc(<VAR>what</VAR>)
</PRE>

<P>
is performed and its result is ignored; again, it is not an error if
<VAR>where</VAR> does not define a verb named <SAMP>`enterfunc'</SAMP>.
</DL>

</P>
<P><HR><P>
Go to the <A HREF="ProgrammersManual_1.html">first</A>, <A HREF="ProgrammersManual_47.html">previous</A>, <A HREF="ProgrammersManual_49.html">next</A>, <A HREF="ProgrammersManual_77.html">last</A> section, <A HREF="ProgrammersManual_toc.html">table of contents</A>.
</BODY>
</HTML>