MSIR.0797 No method linking for implied object: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Automatically generated page update)
(Automatically generated page update)
Line 1: Line 1:
A method with an implied object or class was specified, and was followed by another method. This is not allowed.<pre> For example, in the following:<pre> %list is object stringList ... %list = new</pre><pre> the new method, has an implied class (stringList) and is treated the same as if the class was made explicit:<pre> %list is object stringList ... %list = %(stringList):new</pre> However, when the implied class or object syntax is used, a subsequent method cannot be linked to the previous method.<pre> The following, for example, is invalid:<pre> %list is object stringList ... %list = new:sort('1,10,A')</pre> Values of an enumeration are considered shared members of the class so are subject to this restriction, too.  
A method with an implied object or class was specified, and was followed by another method. This is not allowed.<p class="code"> For example, in the following:<p class="code"> %list is object stringList ... %list = new</pre><p class="code"> the new method, has an implied class (stringList) and is treated the same as if the class was made explicit:<p class="code"> %list is object stringList ... %list = %(stringList):new</pre> However, when the implied class or object syntax is used, a subsequent method cannot be linked to the previous method.<p class="code"> The following, for example, is invalid:<p class="code"> %list is object stringList ... %list = new:sort('1,10,A')</pre> Values of an enumeration are considered shared members of the class so are subject to this restriction, too.  


<pre> In the odd cases where one might wish to perform another method on the result of a method with an implied class or object, simply split the two methods into two statements:<pre> %list is object stringList ... %list = new %list = %list:sort('1,10,A')</pre> While, perhaps slightly inconvenient, this has no negative performance impact. The above example is, of course, silly, as there's no point in sorting a new, and so empty, StringList.
<p class="code"> In the odd cases where one might wish to perform another method on the result of a method with an implied class or object, simply split the two methods into two statements:<p class="code"> %list is object stringList ... %list = new %list = %list:sort('1,10,A')</pre> While, perhaps slightly inconvenient, this has no negative performance impact. The above example is, of course, silly, as there's no point in sorting a new, and so empty, StringList.


[[Category:Sirius Mods messages]]
[[Category:Sirius Mods messages]]

Revision as of 17:40, 23 April 2014

A method with an implied object or class was specified, and was followed by another method. This is not allowed.

For example, in the following:

%list is object stringList ... %list = new

the new method, has an implied class (stringList) and is treated the same as if the class was made explicit:

%list is object stringList ... %list = %(stringList):new However, when the implied class or object syntax is used, a subsequent method cannot be linked to the previous method.

The following, for example, is invalid:

%list is object stringList ... %list = new:sort('1,10,A') Values of an enumeration are considered shared members of the class so are subject to this restriction, too.

In the odd cases where one might wish to perform another method on the result of a method with an implied class or object, simply split the two methods into two statements:

%list is object stringList ... %list = new %list = %list:sort('1,10,A') While, perhaps slightly inconvenient, this has no negative performance impact. The above example is, of course, silly, as there's no point in sorting a new, and so empty, StringList.