Clone
Gustaf Neumann <neumann@wu-wien.ac.at>
committed
on 11 Jun 20
improve spelling
define-incrementals + 6 more
doc/next-migration.html (+444 -444)
719 719     reinstall();
720 720   }
721 721
722 722   timerId = setInterval(reinstall, 500);
723 723   if (document.addEventListener)
724 724     document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
725 725   else
726 726     window.onload = reinstallAndRemoveTimer;
727 727 }
728 728
729 729 }
730 730 asciidoc.install(3);
731 731 /*]]>*/
732 732 </script>
733 733 </head>
734 734 <body class="article">
735 735 <div id="header">
736 736 <h1>Migration Guide for the Next Scripting Language</h1>
737 737 <span id="author">Gustaf Neumann</span><br />
738 738 <span id="email"><code>&lt;<a href="mailto:neumann@wu-wien.ac.at">neumann@wu-wien.ac.at</a>&gt;</code></span><br />
739   <span id="revnumber">version 2.0.0,</span>
740   <span id="revdate">November 2014</span>
  739 <span id="revnumber">version 2.1.0,</span>
  740 <span id="revdate">December 2016</span>
741 741 <br /><span id="revremark"></span>
742 742 <div id="toc">
743 743   <div id="toctitle">Table of Contents</div>
744 744   <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
745 745 </div>
746 746 </div>
747 747 <div id="content">
748 748 <div id="preamble">
749 749 <div class="sectionbody">
750 750 <div class="sidebarblock">
751 751 <div class="content">
752 752 <div class="title">Abstract</div>
753 753 <div class="paragraph"><p>This document describes the differences between the Next Scripting
754 754 Language Framework and XOTcl 1. In particular, it presents a
755 755 migration guide from XOTcl 1 to NX, and presents potential
756 756 incompatibilities beween XOTcl 1 and XOTcl 2.</p></div>
757 757 </div></div>
758 758 <div class="paragraph"><p>The Next Scripting Language (NX) is a successor of XOTcl 1 and is
759 759 based on 10 years of experience with XOTcl in projects containing
760 760 several hundert thousand lines of code. While XOTcl was the first
 
1086 1086 <tr>
1087 1087 <th align="left" valign="top">Stack example in NX </th>
1088 1088 <th align="left" valign="top">Stack example in XOTcl</th>
1089 1089 </tr>
1090 1090 </thead>
1091 1091 <tbody>
1092 1092 <tr>
1093 1093 <td align="left" valign="top"><div><div class="listingblock">
1094 1094 <div class="content"><style type='text/css'>
1095 1095 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
1096 1096 table.nx        {border-collapse: collapse; border-spacing: 3px;}
1097 1097 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
1098 1098 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
1099 1099 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
1100 1100 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
1101 1101 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
1102 1102 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
1103 1103 </style>
1104 1104 <pre class='nx'><span class='nx-keyword'>Class</span> <span class='nx-keyword'>create</span> Stack {
1105 1105
1106      <span class='nx-comment'>#
1107   </span>   <span class='nx-comment'># Stack of Things
1108   </span>   <span class='nx-comment'>#
  1106    <span class='nx-[namespace tail [nx::self]]'>#
  1107 </span>   <span class='nx-[namespace tail [nx::self]]'># Stack of Things
  1108 </span>   <span class='nx-[namespace tail [nx::self]]'>#
1109 1109 </span>
1110 1110    <span class='nx-keyword'>:variable</span> things <span class='nx-string'>""</span>
1111 1111
1112 1112    <span class='nx-keyword'>:public</span> <span class='nx-keyword'>method</span> push {thing} {
1113         <span class='nx-keyword'>set</span> :things [<span class='nx-keyword'>linsert</span> <span class='nx-variable'>${</span><span class='nx-variable'>:things}</span> 0 <span class='nx-variable'>$thing</span>]
1114         <span class='nx-keyword'>return</span> <span class='nx-variable'>$thing</span>
  1113       <span class='nx-keyword'>set</span> :things [<span class='nx-keyword'>linsert</span> <span class='nx-[namespace tail [nx::self]]'>${</span><span class='nx-variable'>:things}</span> 0 <span class='nx-[namespace tail [nx::self]]'>$thing</span>]
  1114       <span class='nx-keyword'>return</span> <span class='nx-[namespace tail [nx::self]]'>$thing</span>
1115 1115    }
1116 1116
1117 1117    <span class='nx-keyword'>:public</span> <span class='nx-keyword'>method</span> pop {} {
1118         <span class='nx-keyword'>set</span> top [<span class='nx-keyword'>lindex</span> <span class='nx-variable'>${</span><span class='nx-variable'>:things}</span> 0]
1119         <span class='nx-keyword'>set</span> :things [<span class='nx-keyword'>lrange</span> <span class='nx-variable'>${</span><span class='nx-variable'>:things}</span> 1 end]
1120         <span class='nx-keyword'>return</span> <span class='nx-variable'>$top</span>
  1118       <span class='nx-keyword'>set</span> top [<span class='nx-keyword'>lindex</span> <span class='nx-[namespace tail [nx::self]]'>${</span><span class='nx-variable'>:things}</span> 0]
  1119       <span class='nx-keyword'>set</span> :things [<span class='nx-keyword'>lrange</span> <span class='nx-[namespace tail [nx::self]]'>${</span><span class='nx-variable'>:things}</span> 1 end]
  1120       <span class='nx-keyword'>return</span> <span class='nx-[namespace tail [nx::self]]'>$top</span>
1121 1121    }
1122 1122 }</pre></div></div></div></td>
1123 1123 <td align="left" valign="top"><div><div class="listingblock">
1124 1124 <div class="content"><style type='text/css'>
1125 1125 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
1126 1126 table.nx        {border-collapse: collapse; border-spacing: 3px;}
1127 1127 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
1128 1128 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
1129 1129 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
1130 1130 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
1131 1131 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
1132 1132 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
1133 1133 </style>
1134   <pre class='nx'><span class='nx-comment'>#
1135   </span><span class='nx-comment'># Stack of Things
1136   </span><span class='nx-comment'>#
  1134 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'>#
  1135 </span><span class='nx-[namespace tail [nx::self]]'># Stack of Things
  1136 </span><span class='nx-[namespace tail [nx::self]]'>#
1137 1137 </span>
1138 1138 <span class='nx-keyword'>Class</span> Stack
1139 1139
1140 1140 Stack instproc <span class='nx-keyword'>init</span> {} {
1141 1141    <span class='nx-keyword'>my</span> instvar things
1142 1142    <span class='nx-keyword'>set</span> things <span class='nx-string'>""</span>
1143 1143 }
1144 1144
1145 1145 Stack instproc push {thing} {
1146 1146    <span class='nx-keyword'>my</span> instvar things
1147      <span class='nx-keyword'>set</span> things [<span class='nx-keyword'>linsert</span> <span class='nx-variable'>$things</span> 0 <span class='nx-variable'>$thing</span>]
1148      <span class='nx-keyword'>return</span> <span class='nx-variable'>$thing</span>
  1147    <span class='nx-keyword'>set</span> things [<span class='nx-keyword'>linsert</span> <span class='nx-[namespace tail [nx::self]]'>$things</span> 0 <span class='nx-[namespace tail [nx::self]]'>$thing</span>]
  1148    <span class='nx-keyword'>return</span> <span class='nx-[namespace tail [nx::self]]'>$thing</span>
1149 1149 }
1150 1150
1151 1151 Stack instproc pop {} {
1152 1152    <span class='nx-keyword'>my</span> instvar things
1153      <span class='nx-keyword'>set</span> top [<span class='nx-keyword'>lindex</span> <span class='nx-variable'>$things</span> 0]
1154      <span class='nx-keyword'>set</span> things [<span class='nx-keyword'>lrange</span> <span class='nx-variable'>$things</span> 1 end]
  1153    <span class='nx-keyword'>set</span> top [<span class='nx-keyword'>lindex</span> <span class='nx-[namespace tail [nx::self]]'>$things</span> 0]
  1154    <span class='nx-keyword'>set</span> things [<span class='nx-keyword'>lrange</span> <span class='nx-[namespace tail [nx::self]]'>$things</span> 1 end]
1155 1155 }</pre></div></div></div></td>
1156 1156 </tr>
1157 1157 </tbody>
1158 1158 </table>
1159 1159 </div>
1160 1160 </div>
1161 1161 <div class="sect2">
1162 1162 <h3 id="_using_xotcl_2_0_and_the_next_scripting_language_in_a_single_interpreter">1.3. Using XOTcl 2.0 and the Next Scripting Language in a Single Interpreter</h3>
1163 1163 <div class="paragraph"><p>In general, the Next Scripting Framework supports multiple object
1164 1164 systems concurrently. Effectively, every object system has different
1165 1165 base classes for creating objects and classes. Therefore, these object
1166 1166 systems can have different different interfaces and names of built-in
1167 1167 methods. Currently, the Next Scripting Framework is packaged with
1168 1168 three object systems:</p></div>
1169 1169 <div class="ulist"><ul>
1170 1170 <li>
1171 1171 <p>
1172 1172 NX
1173 1173 </p>
1174 1174 </li>
 
1189 1189 <div class="paragraph"><p>A single Tcl interpreter can host multiple Next Scripting Object
1190 1190 Systems at the same time. This fact makes migration from XOTcl to NX
1191 1191 easier. The following example script shows to use XOTcl and NX in a
1192 1192 single script:</p></div>
1193 1193 <div class="listingblock">
1194 1194 <div class="title">Using Multiple Object Systems in a single Script</div>
1195 1195 <div class="content"><style type='text/css'>
1196 1196 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
1197 1197 table.nx        {border-collapse: collapse; border-spacing: 3px;}
1198 1198 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
1199 1199 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
1200 1200 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
1201 1201 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
1202 1202 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
1203 1203 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
1204 1204 </style>
1205 1205 <pre class='nx'><span class='nx-keyword'>namespace</span> <span class='nx-keyword'>eval</span> mypackage {
1206 1206
1207 1207   <span class='nx-keyword'>package</span> <span class='nx-keyword'>require</span> XOTcl 2.0
1208 1208
1209     <span class='nx-comment'># Define a class with a public method foo using XOTcl
  1209   <span class='nx-[namespace tail [nx::self]]'># Define a class with a public method foo using XOTcl
1210 1210 </span>  <span class='nx-keyword'>xotcl::Class</span> C1
1211 1211   C1 instproc foo {} {<span class='nx-keyword'>puts</span> <span class='nx-string'>"hello world"</span>}
1212 1212
1213 1213   <span class='nx-keyword'>package</span> <span class='nx-keyword'>require</span> nx
1214 1214
1215     <span class='nx-comment'># Define a class with a public method foo using NX
  1215   <span class='nx-[namespace tail [nx::self]]'># Define a class with a public method foo using NX
1216 1216 </span>  <span class='nx-keyword'>nx::Class</span> <span class='nx-keyword'>create</span> C2 {
1217 1217     <span class='nx-keyword'>:public</span> <span class='nx-keyword'>method</span> foo {} {<span class='nx-keyword'>puts</span> <span class='nx-string'>"hello world"</span>}
1218 1218   }
1219 1219 }</pre></div></div>
1220 1220 <div class="paragraph"><p>One could certainly create object or classes from the different object
1221 1221 systems via fully qualified names (e.g. using e.g. <code>::xotcl::Class</code> or
1222 1222 <code>::nx::Class</code>), but for migration for systems without explicit
1223 1223 namespaces switching between the object systems eases migration.
1224 1224 "Switching" between XOTcl and NX effectively means the load some
1225 1225 packages (if needed) and to import either the base classes (Object and
1226 1226 Class) of XOTcl or NX into the current namespace.</p></div>
1227 1227 </div>
1228 1228 </div>
1229 1229 </div>
1230 1230 <div class="sect1">
1231 1231 <h2 id="_xotcl_idioms_in_the_next_scripting_language">2. XOTcl Idioms in the Next Scripting Language</h2>
1232 1232 <div class="sectionbody">
1233 1233 <div class="paragraph"><p>The following sections are intended for reader familiar with XOTcl and
1234 1234 show, how certain language Idioms of XOTcl can be expressed in NX. In
1235 1235 some cases, multiple possible realizations are listed</p></div>
 
1351 1351 <col width="50%" />
1352 1352 <thead>
1353 1353 <tr>
1354 1354 <th align="left" valign="middle">XOTcl </th>
1355 1355 <th align="left" valign="middle">Next Scripting Language</th>
1356 1356 </tr>
1357 1357 </thead>
1358 1358 <tbody>
1359 1359 <tr>
1360 1360 <td align="left" valign="middle"><div><div class="listingblock">
1361 1361 <div class="content"><style type='text/css'>
1362 1362 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
1363 1363 table.nx        {border-collapse: collapse; border-spacing: 3px;}
1364 1364 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
1365 1365 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
1366 1366 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
1367 1367 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
1368 1368 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
1369 1369 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
1370 1370 </style>
1371   <pre class='nx'><span class='nx-comment'># Define instance method 'foo' and object
1372   </span><span class='nx-comment'># method 'bar' for a Class 'C' with separate
1373   </span><span class='nx-comment'># toplevel commands
  1371 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Define instance method 'foo' and object
  1372 </span><span class='nx-[namespace tail [nx::self]]'># method 'bar' for a Class 'C' with separate
  1373 </span><span class='nx-[namespace tail [nx::self]]'># toplevel commands
1374 1374 </span>
1375 1375 <span class='nx-keyword'>Class</span> C
1376 1376 C instproc foo args {...}
1377 1377 C <span class='nx-keyword'>proc</span> bar args {...}</pre></div></div></div></td>
1378 1378 <td align="left" valign="middle"><div><div class="listingblock">
1379 1379 <div class="content"><style type='text/css'>
1380 1380 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
1381 1381 table.nx        {border-collapse: collapse; border-spacing: 3px;}
1382 1382 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
1383 1383 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
1384 1384 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
1385 1385 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
1386 1386 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
1387 1387 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
1388 1388 </style>
1389   <pre class='nx'><span class='nx-comment'># Define instance method and object method
1390   </span><span class='nx-comment'># in the init-block of a class
  1389 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Define instance method and object method
  1390 </span><span class='nx-[namespace tail [nx::self]]'># in the init-block of a class
1391 1391 </span>
1392 1392 <span class='nx-keyword'>Class</span> <span class='nx-keyword'>create</span> C {
1393 1393   <span class='nx-keyword'>:method</span> foo args {...}
1394 1394   <span class='nx-keyword'>:object</span> <span class='nx-keyword'>method</span> bar args {...}
1395 1395 }</pre></div></div>
1396 1396 <div class="listingblock">
1397 1397 <div class="content"><style type='text/css'>
1398 1398 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
1399 1399 table.nx        {border-collapse: collapse; border-spacing: 3px;}
1400 1400 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
1401 1401 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
1402 1402 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
1403 1403 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
1404 1404 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
1405 1405 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
1406 1406 </style>
1407   <pre class='nx'><span class='nx-comment'># Define instance method and object method
1408   </span><span class='nx-comment'># with separate commands
  1407 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Define instance method and object method
  1408 </span><span class='nx-[namespace tail [nx::self]]'># with separate commands
1409 1409 </span>
1410 1410 <span class='nx-keyword'>Class</span> <span class='nx-keyword'>create</span> C
1411 1411 C <span class='nx-keyword'>method</span> foo args {...}
1412 1412 C <span class='nx-keyword'>object</span> <span class='nx-keyword'>method</span> bar args {...}</pre></div></div></div></td>
1413 1413 </tr>
1414 1414 <tr>
1415 1415 <td align="left" valign="middle"><div><div class="listingblock">
1416 1416 <div class="content"><style type='text/css'>
1417 1417 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
1418 1418 table.nx        {border-collapse: collapse; border-spacing: 3px;}
1419 1419 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
1420 1420 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
1421 1421 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
1422 1422 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
1423 1423 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
1424 1424 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
1425 1425 </style>
1426   <pre class='nx'><span class='nx-comment'># Define object-specific method foo
1427   </span><span class='nx-comment'># for an object 'o' with separate commands
  1426 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Define object-specific method foo
  1427 </span><span class='nx-[namespace tail [nx::self]]'># for an object 'o' with separate commands
1428 1428 </span>
1429 1429 <span class='nx-keyword'>Object</span> o
1430 1430 o <span class='nx-keyword'>set</span> x 1
1431 1431 o <span class='nx-keyword'>proc</span> foo args {...}</pre></div></div></div></td>
1432 1432 <td align="left" valign="middle"><div><div class="listingblock">
1433 1433 <div class="content"><style type='text/css'>
1434 1434 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
1435 1435 table.nx        {border-collapse: collapse; border-spacing: 3px;}
1436 1436 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
1437 1437 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
1438 1438 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
1439 1439 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
1440 1440 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
1441 1441 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
1442 1442 </style>
1443   <pre class='nx'><span class='nx-comment'># Define object method and set
1444   </span><span class='nx-comment'># instance variable in the init-block of
1445   </span><span class='nx-comment'># an object
  1443 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Define object method and set
  1444 </span><span class='nx-[namespace tail [nx::self]]'># instance variable in the init-block of
  1445 </span><span class='nx-[namespace tail [nx::self]]'># an object
1446 1446 </span>
1447 1447 <span class='nx-keyword'>Object</span> <span class='nx-keyword'>create</span> o {
1448 1448   <span class='nx-keyword'>set</span> :x 1
1449 1449   <span class='nx-keyword'>:object</span> <span class='nx-keyword'>method</span> foo args {...}
1450 1450 }</pre></div></div>
1451 1451 <div class="listingblock">
1452 1452 <div class="content"><style type='text/css'>
1453 1453 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
1454 1454 table.nx        {border-collapse: collapse; border-spacing: 3px;}
1455 1455 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
1456 1456 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
1457 1457 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
1458 1458 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
1459 1459 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
1460 1460 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
1461 1461 </style>
1462   <pre class='nx'><span class='nx-comment'># Define object method and set
1463   </span><span class='nx-comment'># instance variable with separate
1464   </span><span class='nx-comment'># commands
  1462 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Define object method and set
  1463 </span><span class='nx-[namespace tail [nx::self]]'># instance variable with separate
  1464 </span><span class='nx-[namespace tail [nx::self]]'># commands
1465 1465 </span>
1466 1466 <span class='nx-keyword'>Object</span> <span class='nx-keyword'>create</span> o
1467 1467 o <span class='nx-keyword'>eval</span> {<span class='nx-keyword'>set</span> :x 1}
1468 1468 o <span class='nx-keyword'>object</span> <span class='nx-keyword'>method</span> foo args {...}</pre></div></div></div></td>
1469 1469 </tr>
1470 1470 </tbody>
1471 1471 </table>
1472 1472 </div>
1473 1473 </div>
1474 1474 <div class="sect3">
1475 1475 <h4 id="_different_kinds_of_methods">2.2.2. Different Kinds of Methods</h4>
1476 1476 <div class="paragraph"><p>This section describes various kinds of methods. The different kinds
1477 1477 of methods are defined via different method-defining methods, which
1478 1478 are summarized in the following table for XOTcl and NX.</p></div>
1479 1479 <div class="tableblock">
1480 1480 <table rules="all"
1481 1481 width="100%"
1482 1482 frame="void"
1483 1483 cellspacing="0" cellpadding="4">
1484 1484 <col width="50%" />
1485 1485 <col width="50%" />
1486 1486 <thead>
1487 1487 <tr>
1488 1488 <th align="left" valign="middle">XOTcl </th>
1489 1489 <th align="left" valign="middle">Next Scripting Language</th>
1490 1490 </tr>
1491 1491 </thead>
1492 1492 <tbody>
1493 1493 <tr>
1494 1494 <td align="left" valign="middle"><div><div class="listingblock">
1495 1495 <div class="content"><style type='text/css'>
1496 1496 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
1497 1497 table.nx        {border-collapse: collapse; border-spacing: 3px;}
1498 1498 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
1499 1499 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
1500 1500 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
1501 1501 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
1502 1502 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
1503 1503 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
1504 1504 </style>
1505   <pre class='nx'><span class='nx-comment'># Methods for defining methods:
1506   </span><span class='nx-comment'>#
1507   </span><span class='nx-comment'>#     proc
1508   </span><span class='nx-comment'>#     instproc
1509   </span><span class='nx-comment'>#     forward
1510   </span><span class='nx-comment'>#     instforward
1511   </span><span class='nx-comment'>#     parametercmd
1512   </span><span class='nx-comment'>#     instparametercmd
1513   </span><span class='nx-comment'>#
1514   </span><span class='nx-comment'># All these methods return empty.</span></pre></div></div></div></td>
  1505 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Methods for defining methods:
  1506 </span><span class='nx-[namespace tail [nx::self]]'>#
  1507 </span><span class='nx-[namespace tail [nx::self]]'>#     proc
  1508 </span><span class='nx-[namespace tail [nx::self]]'>#     instproc
  1509 </span><span class='nx-[namespace tail [nx::self]]'>#     forward
  1510 </span><span class='nx-[namespace tail [nx::self]]'>#     instforward
  1511 </span><span class='nx-[namespace tail [nx::self]]'>#     parametercmd
  1512 </span><span class='nx-[namespace tail [nx::self]]'>#     instparametercmd
  1513 </span><span class='nx-[namespace tail [nx::self]]'>#
  1514 </span><span class='nx-[namespace tail [nx::self]]'># All these methods return empty.</span></pre></div></div></div></td>
1515 1515 <td align="left" valign="middle"><div><div class="listingblock">
1516 1516 <div class="content"><style type='text/css'>
1517 1517 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
1518 1518 table.nx        {border-collapse: collapse; border-spacing: 3px;}
1519 1519 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
1520 1520 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
1521 1521 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
1522 1522 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
1523 1523 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
1524 1524 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
1525 1525 </style>
1526   <pre class='nx'><span class='nx-comment'># Methods for defining methods:
1527   </span><span class='nx-comment'>#
1528   </span><span class='nx-comment'>#     alias
1529   </span><span class='nx-comment'>#     forward
1530   </span><span class='nx-comment'>#     method
1531   </span><span class='nx-comment'>#
1532   </span><span class='nx-comment'># All these methods return method-handles.</span></pre></div></div></div></td>
  1526 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Methods for defining methods:
  1527 </span><span class='nx-[namespace tail [nx::self]]'>#
  1528 </span><span class='nx-[namespace tail [nx::self]]'>#     alias
  1529 </span><span class='nx-[namespace tail [nx::self]]'>#     forward
  1530 </span><span class='nx-[namespace tail [nx::self]]'>#     method
  1531 </span><span class='nx-[namespace tail [nx::self]]'>#
  1532 </span><span class='nx-[namespace tail [nx::self]]'># All these methods return method-handles.</span></pre></div></div></div></td>
1533 1533 </tr>
1534 1534 </tbody>
1535 1535 </table>
1536 1536 </div>
1537 1537 <div class="paragraph"><p>In addition to scripted methods (previous section) XOTcl supports
1538 1538 forwarder (called <code>forward</code> and <code>instforward</code>) and accessor functions
1539 1539 to variables (called <code>parametercmd</code> and <code>instparametercmd</code>).  The
1540 1540 accessor functions are used normally internally when object-specific
1541 1541 parameters are defined (see Section 3.4).</p></div>
1542 1542 <div class="paragraph"><p>In NX forwarders are called <code>forward</code>. NX does not provide an public
1543 1543 available method to define variable accessors like <code>parametercmd</code> in
1544 1544 XOTcl, but use interanlly the Next Scripting Framework primitive
1545 1545 <code>nsf::method::setter</code> when appropriate.</p></div>
1546 1546 <div class="tableblock">
1547 1547 <table rules="all"
1548 1548 width="100%"
1549 1549 frame="void"
1550 1550 cellspacing="0" cellpadding="4">
1551 1551 <col width="50%" />
1552 1552 <col width="50%" />
 
1569 1569 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
1570 1570 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
1571 1571 </style>
1572 1572 <pre class='nx'><span class='nx-keyword'>Class</span> C
1573 1573 C instforward f1 ...
1574 1574 C <span class='nx-keyword'>forward</span> f2 ...
1575 1575
1576 1576 <span class='nx-keyword'>Object</span> o
1577 1577 o <span class='nx-keyword'>forward</span> f3 ...</pre></div></div></div></td>
1578 1578 <td align="left" valign="middle"><div><div class="listingblock">
1579 1579 <div class="content"><style type='text/css'>
1580 1580 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
1581 1581 table.nx        {border-collapse: collapse; border-spacing: 3px;}
1582 1582 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
1583 1583 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
1584 1584 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
1585 1585 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
1586 1586 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
1587 1587 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
1588 1588 </style>
1589   <pre class='nx'><span class='nx-comment'># Define forwarder
  1589 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Define forwarder
1590 1590 </span>
1591 1591 <span class='nx-keyword'>Class</span> <span class='nx-keyword'>create</span> C {
1592 1592   <span class='nx-keyword'>:forward</span> f1 ...
1593 1593   <span class='nx-keyword'>:object</span> <span class='nx-keyword'>forward</span> f2 ...
1594 1594 }
1595 1595
1596 1596 <span class='nx-keyword'>Object</span> <span class='nx-keyword'>create</span> o {
1597 1597   <span class='nx-keyword'>:object</span> <span class='nx-keyword'>forward</span> f3 ...
1598 1598 }</pre></div></div></div></td>
1599 1599 </tr>
1600 1600 <tr>
1601 1601 <td align="left" valign="middle"><div><div class="listingblock">
1602 1602 <div class="content"><style type='text/css'>
1603 1603 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
1604 1604 table.nx        {border-collapse: collapse; border-spacing: 3px;}
1605 1605 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
1606 1606 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
1607 1607 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
1608 1608 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
1609 1609 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
1610 1610 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
1611 1611 </style>
1612   <pre class='nx'><span class='nx-comment'># Define setter and getter methods in XOTcl.
1613   </span><span class='nx-comment'>#
1614   </span><span class='nx-comment'># XOTcl provides methods for these.
  1612 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Define setter and getter methods in XOTcl.
  1613 </span><span class='nx-[namespace tail [nx::self]]'>#
  1614 </span><span class='nx-[namespace tail [nx::self]]'># XOTcl provides methods for these.
1615 1615 </span>
1616 1616 <span class='nx-keyword'>Class</span> C
1617 1617 C instparametercmd p1
1618 1618 C parametercmd p2
1619 1619
1620 1620 <span class='nx-keyword'>Object</span> o
1621 1621 o parametercmd p3</pre></div></div></div></td>
1622 1622 <td align="left" valign="middle"><div><div class="listingblock">
1623 1623 <div class="content"><style type='text/css'>
1624 1624 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
1625 1625 table.nx        {border-collapse: collapse; border-spacing: 3px;}
1626 1626 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
1627 1627 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
1628 1628 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
1629 1629 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
1630 1630 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
1631 1631 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
1632 1632 </style>
1633   <pre class='nx'><span class='nx-comment'># Define setter and getter methods in NX.
1634   </span><span class='nx-comment'>#
1635   </span><span class='nx-comment'># NX does not provide own methods, but uses
1636   </span><span class='nx-comment'># the low level framework commands, since
1637   </span><span class='nx-comment'># application developer will only seldomly
1638   </span><span class='nx-comment'># need it.
  1633 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Define setter and getter methods in NX.
  1634 </span><span class='nx-[namespace tail [nx::self]]'>#
  1635 </span><span class='nx-[namespace tail [nx::self]]'># NX does not provide own methods, but uses
  1636 </span><span class='nx-[namespace tail [nx::self]]'># the low level framework commands, since
  1637 </span><span class='nx-[namespace tail [nx::self]]'># application developer will only seldomly
  1638 </span><span class='nx-[namespace tail [nx::self]]'># need it.
1639 1639 </span>
1640 1640 <span class='nx-keyword'>Class</span> <span class='nx-keyword'>create</span> C
1641 1641 ::nsf::method::setter C p1
1642 1642 ::nsf::method::setter C -per-object p2
1643 1643
1644 1644 <span class='nx-keyword'>Object</span> <span class='nx-keyword'>create</span> o
1645 1645 ::nsf::method::setter o p3</pre></div></div></div></td>
1646 1646 </tr>
1647 1647 </tbody>
1648 1648 </table>
1649 1649 </div>
1650 1650 <div class="paragraph"><p>NX supports in contrary to XOTcl the method <code>alias</code> which can be used
1651 1651 to register arbitrary Tcl commands or methods for an object or class
1652 1652 under a provided method name. Aliases can be used to reuse a certain implementation in
1653 1653 e.g. different object systems under potentially different names. In
1654 1654 some respects aliases are similar to forwarders, but they do not
1655 1655 involve forwarding overhead.</p></div>
1656 1656 <div class="tableblock">
1657 1657 <table rules="all"
1658 1658 width="100%"
 
1662 1662 <col width="50%" />
1663 1663 <thead>
1664 1664 <tr>
1665 1665 <th align="left" valign="middle">XOTcl </th>
1666 1666 <th align="left" valign="middle">Next Scripting Language</th>
1667 1667 </tr>
1668 1668 </thead>
1669 1669 <tbody>
1670 1670 <tr>
1671 1671 <td align="left" valign="middle"><div><div class="listingblock">
1672 1672 <div class="content"><style type='text/css'>
1673 1673 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
1674 1674 table.nx        {border-collapse: collapse; border-spacing: 3px;}
1675 1675 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
1676 1676 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
1677 1677 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
1678 1678 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
1679 1679 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
1680 1680 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
1681 1681 </style>
1682   <pre class='nx'><span class='nx-comment'># Method "alias" not available</span></pre></div></div></div></td>
  1682 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Method "alias" not available</span></pre></div></div></div></td>
1683 1683 <td align="left" valign="middle"><div><div class="listingblock">
1684 1684 <div class="content"><style type='text/css'>
1685 1685 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
1686 1686 table.nx        {border-collapse: collapse; border-spacing: 3px;}
1687 1687 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
1688 1688 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
1689 1689 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
1690 1690 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
1691 1691 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
1692 1692 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
1693 1693 </style>
1694   <pre class='nx'><span class='nx-comment'># Define method aliases
1695   </span><span class='nx-comment'># (to scripted or non-scripted methods)
  1694 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Define method aliases
  1695 </span><span class='nx-[namespace tail [nx::self]]'># (to scripted or non-scripted methods)
1696 1696 </span>
1697 1697 <span class='nx-keyword'>Class</span> <span class='nx-keyword'>create</span> C {
1698 1698   <span class='nx-keyword'>:alias</span> a1 ...
1699 1699   <span class='nx-keyword'>:object</span> <span class='nx-keyword'>alias</span> a2 ...
1700 1700 }
1701 1701
1702 1702 <span class='nx-keyword'>Object</span> <span class='nx-keyword'>create</span> o {
1703 1703   <span class='nx-keyword'>:object</span> <span class='nx-keyword'>alias</span> a3 ...
1704 1704 }</pre></div></div></div></td>
1705 1705 </tr>
1706 1706 </tbody>
1707 1707 </table>
1708 1708 </div>
1709 1709 </div>
1710 1710 <div class="sect3">
1711 1711 <h4 id="method-protect-example">2.2.3. Method Modifiers and Method Protection</h4>
1712 1712 <div class="paragraph"><p>NX supports four method modifiers <code>object</code>, <code>public</code>, <code>protected</code> and
1713 1713 <code>private</code>. All method modifiers can be written in front of every
1714 1714 method defining command. The method modifier <code>object</code> is used to denote
1715 1715 object-specific methods (see above). The concept of method protection
 
1723 1723 <col width="50%" />
1724 1724 <thead>
1725 1725 <tr>
1726 1726 <th align="left" valign="middle">XOTcl </th>
1727 1727 <th align="left" valign="middle">Next Scripting Language</th>
1728 1728 </tr>
1729 1729 </thead>
1730 1730 <tbody>
1731 1731 <tr>
1732 1732 <td align="left" valign="middle"><div><div class="listingblock">
1733 1733 <div class="content"><style type='text/css'>
1734 1734 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
1735 1735 table.nx        {border-collapse: collapse; border-spacing: 3px;}
1736 1736 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
1737 1737 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
1738 1738 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
1739 1739 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
1740 1740 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
1741 1741 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
1742 1742 </style>
1743   <pre class='nx'><span class='nx-comment'># Method modifiers
1744   </span><span class='nx-comment'>#
1745   </span><span class='nx-comment'>#   "object",
1746   </span><span class='nx-comment'>#   "public",
1747   </span><span class='nx-comment'>#   "protected", and
1748   </span><span class='nx-comment'>#   "private"
1749   </span><span class='nx-comment'>#
1750   </span><span class='nx-comment'># are not available</span></pre></div></div></div></td>
  1743 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Method modifiers
  1744 </span><span class='nx-[namespace tail [nx::self]]'>#
  1745 </span><span class='nx-[namespace tail [nx::self]]'>#   "object",
  1746 </span><span class='nx-[namespace tail [nx::self]]'>#   "public",
  1747 </span><span class='nx-[namespace tail [nx::self]]'>#   "protected", and
  1748 </span><span class='nx-[namespace tail [nx::self]]'>#   "private"
  1749 </span><span class='nx-[namespace tail [nx::self]]'>#
  1750 </span><span class='nx-[namespace tail [nx::self]]'># are not available</span></pre></div></div></div></td>
1751 1751 <td align="left" valign="middle"><div><div class="listingblock">
1752 1752 <div class="content"><style type='text/css'>
1753 1753 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
1754 1754 table.nx        {border-collapse: collapse; border-spacing: 3px;}
1755 1755 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
1756 1756 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
1757 1757 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
1758 1758 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
1759 1759 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
1760 1760 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
1761 1761 </style>
1762   <pre class='nx'><span class='nx-comment'># Method modifiers
1763   </span><span class='nx-comment'>#
1764   </span><span class='nx-comment'>#   "object",
1765   </span><span class='nx-comment'>#   "public",
1766   </span><span class='nx-comment'>#   "protected"
1767   </span><span class='nx-comment'>#
1768   </span><span class='nx-comment'># are applicable for all kinds of
1769   </span><span class='nx-comment'># method defining methods:
1770   </span><span class='nx-comment'>#
1771   </span><span class='nx-comment'>#    method, forward, alias
1772   </span><span class='nx-comment'>#
1773   </span><span class='nx-comment'># The modifier "private" is available for
1774   </span><span class='nx-comment'>#
1775   </span><span class='nx-comment'>#    method, forward, alias
1776   </span><span class='nx-comment'>#
  1762 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Method modifiers
  1763 </span><span class='nx-[namespace tail [nx::self]]'>#
  1764 </span><span class='nx-[namespace tail [nx::self]]'>#   "object",
  1765 </span><span class='nx-[namespace tail [nx::self]]'>#   "public",
  1766 </span><span class='nx-[namespace tail [nx::self]]'>#   "protected"
  1767 </span><span class='nx-[namespace tail [nx::self]]'>#
  1768 </span><span class='nx-[namespace tail [nx::self]]'># are applicable for all kinds of
  1769 </span><span class='nx-[namespace tail [nx::self]]'># method defining methods:
  1770 </span><span class='nx-[namespace tail [nx::self]]'>#
  1771 </span><span class='nx-[namespace tail [nx::self]]'>#    method, forward, alias
  1772 </span><span class='nx-[namespace tail [nx::self]]'>#
  1773 </span><span class='nx-[namespace tail [nx::self]]'># The modifier "private" is available for
  1774 </span><span class='nx-[namespace tail [nx::self]]'>#
  1775 </span><span class='nx-[namespace tail [nx::self]]'>#    method, forward, alias
  1776 </span><span class='nx-[namespace tail [nx::self]]'>#
1777 1777 </span><span class='nx-keyword'>Class</span> <span class='nx-keyword'>create</span> C {
1778 1778   :/<span class='nx-keyword'>method</span>-definiton-method/ ...
1779 1779   <span class='nx-keyword'>:public</span> /<span class='nx-keyword'>method</span>-definiton-method/ ...
1780 1780   <span class='nx-keyword'>:protected</span> /<span class='nx-keyword'>method</span>-definiton-method/ ...
1781 1781   <span class='nx-keyword'>:private</span> /<span class='nx-keyword'>method</span>-definiton-method/ ...
1782 1782   <span class='nx-keyword'>:object</span> /<span class='nx-keyword'>method</span>-definiton-method/ ...
1783 1783   <span class='nx-keyword'>:public</span> <span class='nx-keyword'>object</span> /<span class='nx-keyword'>method</span>-definiton-method/ ...
1784 1784   <span class='nx-keyword'>:protected</span> <span class='nx-keyword'>object</span> /<span class='nx-keyword'>method</span>-definiton-method/ ...
1785 1785   <span class='nx-keyword'>:private</span> <span class='nx-keyword'>object</span> /<span class='nx-keyword'>method</span>-definiton-method/ ...
1786 1786 }</pre></div></div></div></td>
1787 1787 </tr>
1788 1788 </tbody>
1789 1789 </table>
1790 1790 </div>
1791 1791 <div class="paragraph"><p>XOTcl does not provide method protection. In NX, all methods are
1792 1792 defined per default as protected. This default can be changed by the
1793 1793 application developer in various ways. The command <code>::nx::configure
1794 1794 defaultMethodCallProtection true|false</code> can be used to set the default
1795 1795 call protection for scripted methods, forwarder and aliases.
1796 1796 The defaults can be overwritten also on a class level.</p></div>
 
1807 1807 <col width="50%" />
1808 1808 <thead>
1809 1809 <tr>
1810 1810 <th align="left" valign="middle">XOTcl </th>
1811 1811 <th align="left" valign="middle">Next Scripting Language</th>
1812 1812 </tr>
1813 1813 </thead>
1814 1814 <tbody>
1815 1815 <tr>
1816 1816 <td align="left" valign="middle"><div><div class="listingblock">
1817 1817 <div class="content"><style type='text/css'>
1818 1818 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
1819 1819 table.nx        {border-collapse: collapse; border-spacing: 3px;}
1820 1820 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
1821 1821 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
1822 1822 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
1823 1823 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
1824 1824 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
1825 1825 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
1826 1826 </style>
1827   <pre class='nx'><span class='nx-comment'># XOTcl provides no means for
1828   </span><span class='nx-comment'># method hiding</span></pre></div></div></div></td>
  1827 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># XOTcl provides no means for
  1828 </span><span class='nx-[namespace tail [nx::self]]'># method hiding</span></pre></div></div></div></td>
1829 1829 <td align="left" valign="middle"><div><div class="listingblock">
1830 1830 <div class="content"><style type='text/css'>
1831 1831 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
1832 1832 table.nx        {border-collapse: collapse; border-spacing: 3px;}
1833 1833 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
1834 1834 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
1835 1835 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
1836 1836 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
1837 1837 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
1838 1838 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
1839 1839 </style>
1840   <pre class='nx'><span class='nx-comment'># Hiding of methods via "private"
1841   </span><span class='nx-comment'>#
  1840 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Hiding of methods via "private"
  1841 </span><span class='nx-[namespace tail [nx::self]]'>#
1842 1842 </span><span class='nx-keyword'>nx::Class</span> <span class='nx-keyword'>create</span> Base {
1843     <span class='nx-keyword'>:private</span> <span class='nx-keyword'>method</span> baz {a b} {<span class='nx-keyword'>expr</span> {<span class='nx-variable'>$a</span> + <span class='nx-variable'>$b</span>}}
1844     <span class='nx-keyword'>:public</span> <span class='nx-keyword'>method</span> foo {a b} {: -local baz <span class='nx-variable'>$a</span> <span class='nx-variable'>$b</span>}
  1843   <span class='nx-keyword'>:private</span> <span class='nx-keyword'>method</span> baz {a b} {<span class='nx-keyword'>expr</span> {<span class='nx-[namespace tail [nx::self]]'>$a</span> + <span class='nx-[namespace tail [nx::self]]'>$b</span>}}
  1844   <span class='nx-keyword'>:public</span> <span class='nx-keyword'>method</span> foo {a b} {: -local baz <span class='nx-[namespace tail [nx::self]]'>$a</span> <span class='nx-[namespace tail [nx::self]]'>$b</span>}
1845 1845 }
1846 1846
1847 1847 <span class='nx-keyword'>nx::Class</span> <span class='nx-keyword'>create</span> Sub -superclass Base {
1848     <span class='nx-keyword'>:public</span> <span class='nx-keyword'>method</span> bar {a b} {: -local baz <span class='nx-variable'>$a</span> <span class='nx-variable'>$b</span>}
1849     <span class='nx-keyword'>:private</span> <span class='nx-keyword'>method</span> baz {a b} {<span class='nx-keyword'>expr</span> {<span class='nx-variable'>$a</span> * <span class='nx-variable'>$b</span>}}
  1848   <span class='nx-keyword'>:public</span> <span class='nx-keyword'>method</span> bar {a b} {: -local baz <span class='nx-[namespace tail [nx::self]]'>$a</span> <span class='nx-[namespace tail [nx::self]]'>$b</span>}
  1849   <span class='nx-keyword'>:private</span> <span class='nx-keyword'>method</span> baz {a b} {<span class='nx-keyword'>expr</span> {<span class='nx-[namespace tail [nx::self]]'>$a</span> * <span class='nx-[namespace tail [nx::self]]'>$b</span>}}
1850 1850
1851 1851   <span class='nx-keyword'>:create</span> s1
1852 1852 }
1853 1853
1854   s1 foo 3 4  ;<span class='nx-comment'># returns 7
1855   </span>s1 bar 3 4  ;<span class='nx-comment'># returns 12
1856   </span>s1 baz 3 4  ;<span class='nx-comment'># unable to dispatch method 'baz'</span></pre></div></div></div></td>
  1854 s1 foo 3 4  ;<span class='nx-[namespace tail [nx::self]]'># returns 7
  1855 </span>s1 bar 3 4  ;<span class='nx-[namespace tail [nx::self]]'># returns 12
  1856 </span>s1 baz 3 4  ;<span class='nx-[namespace tail [nx::self]]'># unable to dispatch method 'baz'</span></pre></div></div></div></td>
1857 1857 </tr>
1858 1858 </tbody>
1859 1859 </table>
1860 1860 </div>
1861 1861 </div>
1862 1862 <div class="sect3">
1863 1863 <h4 id="method-deletion">2.2.4. Method Deletion</h4>
1864 1864 <div class="paragraph"><p>NX provides an explicit <code>delete</code> method for the deletion of methods.</p></div>
1865 1865 <div class="tableblock">
1866 1866 <table rules="all"
1867 1867 width="100%"
1868 1868 frame="void"
1869 1869 cellspacing="0" cellpadding="4">
1870 1870 <col width="50%" />
1871 1871 <col width="50%" />
1872 1872 <thead>
1873 1873 <tr>
1874 1874 <th align="left" valign="middle">XOTcl </th>
1875 1875 <th align="left" valign="middle">Next Scripting Language</th>
1876 1876 </tr>
1877 1877 </thead>
1878 1878 <tbody>
1879 1879 <tr>
1880 1880 <td align="left" valign="middle"><div><div class="listingblock">
1881 1881 <div class="content"><style type='text/css'>
1882 1882 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
1883 1883 table.nx        {border-collapse: collapse; border-spacing: 3px;}
1884 1884 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
1885 1885 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
1886 1886 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
1887 1887 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
1888 1888 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
1889 1889 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
1890 1890 </style>
1891   <pre class='nx'><span class='nx-comment'># XOTcl provides only method deletion with
1892   </span><span class='nx-comment'># the equivalent of Tcl's "proc foo {} {}"
  1891 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># XOTcl provides only method deletion with
  1892 </span><span class='nx-[namespace tail [nx::self]]'># the equivalent of Tcl's "proc foo {} {}"
1893 1893 </span><span class='nx-placeholder'>/cls/</span> instproc foo {} {}
1894 1894 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>proc</span> foo {} {}</pre></div></div></div></td>
1895 1895 <td align="left" valign="middle"><div><div class="listingblock">
1896 1896 <div class="content"><style type='text/css'>
1897 1897 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
1898 1898 table.nx        {border-collapse: collapse; border-spacing: 3px;}
1899 1899 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
1900 1900 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
1901 1901 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
1902 1902 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
1903 1903 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
1904 1904 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
1905 1905 </style>
1906   <pre class='nx'><span class='nx-comment'># Deletion of Methods
1907   </span><span class='nx-comment'>#
  1906 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Deletion of Methods
  1907 </span><span class='nx-[namespace tail [nx::self]]'>#
1908 1908 </span><span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>delete</span> <span class='nx-keyword'>method</span> <span class='nx-placeholder'>/name/</span>
1909 1909 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>delete</span> <span class='nx-keyword'>object</span> <span class='nx-keyword'>method</span> <span class='nx-placeholder'>/name/</span></pre></div></div></div></td>
1910 1910 </tr>
1911 1911 </tbody>
1912 1912 </table>
1913 1913 </div>
1914 1914 </div>
1915 1915 </div>
1916 1916 <div class="sect2">
1917 1917 <h3 id="_resolvers">2.3. Resolvers</h3>
1918 1918 <div class="paragraph"><p>The Next Scripting Framework defines Tcl resolvers for method and
1919 1919 variable names to implement object specific behavior. Within the
1920 1920 bodies of scripted methods these resolver treat variable and function
1921 1921 names starting with a colon <code>:</code> specially. In short, a colon-prefixed
1922 1922 variable name refers to an instance variable, and a colon-prefixed
1923 1923 function name refers to a method. The sub-sections below provide
1924 1924 detailed examples.</p></div>
1925 1925 <div class="paragraph"><p>Note that the resolvers of the Next Scripting Framework can be used in
1926 1926 the XOTcl 2.* environment as well.</p></div>
1927 1927 <div class="sect3">
 
1943 1943 <th align="left" valign="middle">XOTcl </th>
1944 1944 <th align="left" valign="middle">Next Scripting Language</th>
1945 1945 </tr>
1946 1946 </thead>
1947 1947 <tbody>
1948 1948 <tr>
1949 1949 <td align="left" valign="middle"><div><div class="listingblock">
1950 1950 <div class="content"><style type='text/css'>
1951 1951 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
1952 1952 table.nx        {border-collapse: collapse; border-spacing: 3px;}
1953 1953 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
1954 1954 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
1955 1955 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
1956 1956 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
1957 1957 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
1958 1958 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
1959 1959 </style>
1960 1960 <pre class='nx'><span class='nx-keyword'>Class</span> C
1961 1961 C instproc foo args {...}
1962 1962 C instproc bar args {
1963     <span class='nx-keyword'>my</span> foo 1 2 3 ;<span class='nx-comment'># invoke own method
1964   </span>  o baz        ;<span class='nx-comment'># invoke other object's method
  1963   <span class='nx-keyword'>my</span> foo 1 2 3 ;<span class='nx-[namespace tail [nx::self]]'># invoke own method
  1964 </span>  o baz        ;<span class='nx-[namespace tail [nx::self]]'># invoke other object's method
1965 1965 </span>}
1966 1966 <span class='nx-keyword'>Object</span> o
1967 1967 o <span class='nx-keyword'>proc</span> baz {} {...}</pre></div></div></div></td>
1968 1968 <td align="left" valign="middle"><div><div class="listingblock">
1969 1969 <div class="content"><style type='text/css'>
1970 1970 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
1971 1971 table.nx        {border-collapse: collapse; border-spacing: 3px;}
1972 1972 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
1973 1973 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
1974 1974 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
1975 1975 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
1976 1976 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
1977 1977 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
1978 1978 </style>
1979 1979 <pre class='nx'><span class='nx-keyword'>Class</span> <span class='nx-keyword'>create</span> C {
1980 1980   <span class='nx-keyword'>:method</span> foo args {...}
1981 1981   <span class='nx-keyword'>:method</span> bar args {
1982        :foo 1 2 3 ;<span class='nx-comment'># invoke own method
1983   </span>     o baz      ;<span class='nx-comment'># invoke other object's method
  1982      :foo 1 2 3 ;<span class='nx-[namespace tail [nx::self]]'># invoke own method
  1983 </span>     o baz      ;<span class='nx-[namespace tail [nx::self]]'># invoke other object's method
1984 1984 </span>  }
1985 1985 }
1986 1986 <span class='nx-keyword'>Object</span> <span class='nx-keyword'>create</span> o {
1987 1987   <span class='nx-keyword'>:public</span> <span class='nx-keyword'>object</span> <span class='nx-keyword'>method</span> baz {} {...}
1988 1988 }</pre></div></div></div></td>
1989 1989 </tr>
1990 1990 </tbody>
1991 1991 </table>
1992 1992 </div>
1993 1993 </div>
1994 1994 <div class="sect3">
1995 1995 <h4 id="_accessing_own_instance_variables_from_method_bodies">2.3.2. Accessing Own Instance Variables from Method Bodies</h4>
1996 1996 <div class="paragraph"><p>In general, the Next Scripting Language favors the access to an
1997 1997 objects&#8217;s own instance variables over variable accesses of other
1998 1998 objects. This means that in NX it is syntactically easier to access
1999 1999 the own instance variables. On the contrary, in XOTcl, the variable
2000 2000 access to own and other variables are fully symmetric.</p></div>
2001 2001 <div class="paragraph"><p>In XOTcl, the following approaches are used to access instance
2002 2002 variables:</p></div>
2003 2003 <div class="ulist"><ul>
 
2037 2037 <tr>
2038 2038 <th align="left" valign="middle">XOTcl </th>
2039 2039 <th align="left" valign="middle">Next Scripting Language</th>
2040 2040 </tr>
2041 2041 </thead>
2042 2042 <tbody>
2043 2043 <tr>
2044 2044 <td align="left" valign="middle"><div><div class="listingblock">
2045 2045 <div class="content"><style type='text/css'>
2046 2046 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2047 2047 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2048 2048 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2049 2049 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2050 2050 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2051 2051 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2052 2052 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2053 2053 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2054 2054 </style>
2055 2055 <pre class='nx'><span class='nx-keyword'>Class</span> C
2056 2056 C instproc foo args {
2057     <span class='nx-comment'># Method scoped variable a
  2057   <span class='nx-[namespace tail [nx::self]]'># Method scoped variable a
2058 2058 </span>  <span class='nx-keyword'>set</span> a 1
2059     <span class='nx-comment'># Instance variable b
  2059   <span class='nx-[namespace tail [nx::self]]'># Instance variable b
2060 2060 </span>  <span class='nx-keyword'>my</span> instvar b
2061 2061   <span class='nx-keyword'>set</span> b 2
2062     <span class='nx-comment'># Global variable/namespaced variable c
  2062   <span class='nx-[namespace tail [nx::self]]'># Global variable/namespaced variable c
2063 2063 </span>  <span class='nx-keyword'>set</span> ::c 3
2064 2064 }</pre></div></div></div></td>
2065 2065 <td align="left" valign="middle"><div><div class="listingblock">
2066 2066 <div class="content"><style type='text/css'>
2067 2067 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2068 2068 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2069 2069 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2070 2070 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2071 2071 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2072 2072 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2073 2073 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2074 2074 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2075 2075 </style>
2076 2076 <pre class='nx'><span class='nx-keyword'>Class</span> <span class='nx-keyword'>create</span> C {
2077 2077   <span class='nx-keyword'>:method</span> foo args {...}
2078       <span class='nx-comment'># Method scoped variable a
  2078     <span class='nx-[namespace tail [nx::self]]'># Method scoped variable a
2079 2079 </span>    <span class='nx-keyword'>set</span> a 1
2080       <span class='nx-comment'># Instance variable b
  2080     <span class='nx-[namespace tail [nx::self]]'># Instance variable b
2081 2081 </span>    <span class='nx-keyword'>set</span> :b 2
2082       <span class='nx-comment'># Global variable/namespaced variable c
  2082     <span class='nx-[namespace tail [nx::self]]'># Global variable/namespaced variable c
2083 2083 </span>    <span class='nx-keyword'>set</span> ::c 3
2084 2084   }
2085 2085 }</pre></div></div></div></td>
2086 2086 </tr>
2087 2087 <tr>
2088 2088 <td align="left" valign="middle"><div><div class="listingblock">
2089 2089 <div class="content"><style type='text/css'>
2090 2090 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2091 2091 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2092 2092 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2093 2093 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2094 2094 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2095 2095 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2096 2096 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2097 2097 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2098 2098 </style>
2099 2099 <pre class='nx'>... instproc ... {
2100 2100    <span class='nx-keyword'>my</span> <span class='nx-keyword'>set</span> <span class='nx-placeholder'>/varName/</span> <span class='nx-placeholder'>?value?</span>
2101 2101 }</pre></div></div></div></td>
2102 2102 <td align="left" valign="middle"><div><div class="listingblock">
2103 2103 <div class="content"><style type='text/css'>
2104 2104 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2105 2105 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2106 2106 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2107 2107 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2108 2108 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2109 2109 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2110 2110 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2111 2111 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2112 2112 </style>
2113   <pre class='nx'><span class='nx-comment'># Set own instance variable to a value via
2114   </span><span class='nx-comment'># resolver (preferred and fastest way)
  2113 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Set own instance variable to a value via
  2114 </span><span class='nx-[namespace tail [nx::self]]'># resolver (preferred and fastest way)
2115 2115 </span>
2116 2116 ... <span class='nx-keyword'>method</span> ... {
2117 2117    <span class='nx-keyword'>set</span> :<span class='nx-placeholder'>/newVar/</span> <span class='nx-placeholder'>?value?</span>
2118 2118 }</pre></div></div></div></td>
2119 2119 </tr>
2120 2120 <tr>
2121 2121 <td align="left" valign="middle"><div><div class="listingblock">
2122 2122 <div class="content"><style type='text/css'>
2123 2123 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2124 2124 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2125 2125 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2126 2126 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2127 2127 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2128 2128 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2129 2129 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2130 2130 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2131 2131 </style>
2132 2132 <pre class='nx'>... instproc ... {
2133 2133    <span class='nx-keyword'>my</span> instvar <span class='nx-placeholder'>/varName/</span>
2134 2134    <span class='nx-keyword'>set</span> <span class='nx-placeholder'>/varName/</span> <span class='nx-placeholder'>?value?</span>
2135 2135 }</pre></div></div></div></td>
2136 2136 <td align="left" valign="middle"><div><div class="listingblock">
2137 2137 <div class="content"><style type='text/css'>
2138 2138 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2139 2139 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2140 2140 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2141 2141 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2142 2142 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2143 2143 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2144 2144 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2145 2145 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2146 2146 </style>
2147   <pre class='nx'><span class='nx-comment'># Set own instance variable via
2148   </span><span class='nx-comment'># variable import
  2147 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Set own instance variable via
  2148 </span><span class='nx-[namespace tail [nx::self]]'># variable import
2149 2149 </span>
2150 2150 ... <span class='nx-keyword'>method</span> ... {
2151 2151    ::nx::var import [<span class='nx-keyword'>self</span>] <span class='nx-placeholder'>/varName/</span>
2152 2152    <span class='nx-keyword'>set</span> <span class='nx-placeholder'>/varName/</span> <span class='nx-placeholder'>?value?</span>
2153 2153 }</pre></div></div></div></td>
2154 2154 </tr>
2155 2155 <tr>
2156 2156 <td align="left" valign="middle"><div><div class="listingblock">
2157 2157 <div class="content"><style type='text/css'>
2158 2158 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2159 2159 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2160 2160 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2161 2161 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2162 2162 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2163 2163 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2164 2164 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2165 2165 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2166 2166 </style>
2167 2167 <pre class='nx'>... instproc ... {
2168 2168    <span class='nx-keyword'>set</span> <span class='nx-placeholder'>/varName/</span> [<span class='nx-keyword'>my</span> <span class='nx-keyword'>set</span> <span class='nx-placeholder'>/otherVar/</span>]
2169 2169 }</pre></div></div></div></td>
2170 2170 <td align="left" valign="middle"><div><div class="listingblock">
2171 2171 <div class="content"><style type='text/css'>
2172 2172 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2173 2173 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2174 2174 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2175 2175 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2176 2176 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2177 2177 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2178 2178 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2179 2179 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2180 2180 </style>
2181   <pre class='nx'><span class='nx-comment'># Read own instance variable
  2181 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Read own instance variable
2182 2182 </span>
2183 2183 ... <span class='nx-keyword'>method</span> ... {
2184 2184    <span class='nx-keyword'>set</span> <span class='nx-placeholder'>/varName/</span> [<span class='nx-keyword'>set</span> :<span class='nx-placeholder'>/otherVar/</span>]
2185 2185 }</pre></div></div>
2186 2186 <div class="listingblock">
2187 2187 <div class="content"><style type='text/css'>
2188 2188 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2189 2189 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2190 2190 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2191 2191 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2192 2192 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2193 2193 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2194 2194 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2195 2195 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2196 2196 </style>
2197 2197 <pre class='nx'>... <span class='nx-keyword'>method</span> ... {
2198      <span class='nx-keyword'>set</span> <span class='nx-placeholder'>/newVar/</span> <span class='nx-variable'>${</span><span class='nx-variable'>:/otherVar/}</span>
  2198    <span class='nx-keyword'>set</span> <span class='nx-placeholder'>/newVar/</span> <span class='nx-[namespace tail [nx::self]]'>${</span><span class='nx-variable'>:/otherVar/}</span>
2199 2199 }</pre></div></div></div></td>
2200 2200 </tr>
2201 2201 <tr>
2202 2202 <td align="left" valign="middle"><div><div class="listingblock">
2203 2203 <div class="content"><style type='text/css'>
2204 2204 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2205 2205 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2206 2206 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2207 2207 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2208 2208 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2209 2209 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2210 2210 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2211 2211 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2212 2212 </style>
2213 2213 <pre class='nx'>... instproc ... {
2214 2214    <span class='nx-keyword'>my</span> exists <span class='nx-placeholder'>/varName/</span>
2215 2215 }</pre></div></div></div></td>
2216 2216 <td align="left" valign="middle"><div><div class="listingblock">
2217 2217 <div class="content"><style type='text/css'>
2218 2218 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2219 2219 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2220 2220 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2221 2221 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2222 2222 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2223 2223 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2224 2224 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2225 2225 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2226 2226 </style>
2227   <pre class='nx'><span class='nx-comment'># Test existence of own instance variable
  2227 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Test existence of own instance variable
2228 2228 </span>
2229 2229 ... <span class='nx-keyword'>method</span> ... {
2230 2230    <span class='nx-keyword'>info</span> :<span class='nx-placeholder'>/varName/</span>
2231 2231 }</pre></div></div>
2232 2232 <div class="listingblock">
2233 2233 <div class="content"><style type='text/css'>
2234 2234 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2235 2235 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2236 2236 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2237 2237 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2238 2238 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2239 2239 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2240 2240 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2241 2241 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2242 2242 </style>
2243 2243 <pre class='nx'> ... <span class='nx-keyword'>method</span> ... {
2244 2244    ::nx::var exists [<span class='nx-keyword'>self</span>] <span class='nx-placeholder'>/varName/</span>
2245 2245 }</pre></div></div></div></td>
2246 2246 </tr>
2247 2247 </tbody>
 
2271 2271 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2272 2272 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2273 2273 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2274 2274 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2275 2275 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2276 2276 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2277 2277 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2278 2278 </style>
2279 2279 <pre class='nx'><span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>set</span> <span class='nx-placeholder'>/varName/</span> <span class='nx-placeholder'>?value?</span></pre></div></div></div></td>
2280 2280 <td align="left" valign="middle"><div><div class="listingblock">
2281 2281 <div class="content"><style type='text/css'>
2282 2282 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2283 2283 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2284 2284 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2285 2285 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2286 2286 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2287 2287 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2288 2288 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2289 2289 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2290 2290 </style>
2291   <pre class='nx'><span class='nx-comment'># Set instance variable of object obj to a
2292   </span><span class='nx-comment'># value via resolver
2293   </span><span class='nx-comment'># (preferred way: define property on obj)
  2291 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Set instance variable of object obj to a
  2292 </span><span class='nx-[namespace tail [nx::self]]'># value via resolver
  2293 </span><span class='nx-[namespace tail [nx::self]]'># (preferred way: define property on obj)
2294 2294 </span>
2295 2295 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>eval</span> [<span class='nx-keyword'>list</span> <span class='nx-keyword'>set</span> :<span class='nx-placeholder'>/varName/</span> <span class='nx-placeholder'>?value?</span>]</pre></div></div></div></td>
2296 2296 </tr>
2297 2297 <tr>
2298 2298 <td align="left" valign="middle"><div><div class="listingblock">
2299 2299 <div class="content"><style type='text/css'>
2300 2300 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2301 2301 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2302 2302 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2303 2303 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2304 2304 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2305 2305 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2306 2306 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2307 2307 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2308 2308 </style>
2309 2309 <pre class='nx'><span class='nx-keyword'>set</span> <span class='nx-placeholder'>/varName/</span> [<span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>set</span> <span class='nx-placeholder'>/otherVar/</span>]</pre></div></div></div></td>
2310 2310 <td align="left" valign="middle"><div><div class="listingblock">
2311 2311 <div class="content"><style type='text/css'>
2312 2312 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2313 2313 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2314 2314 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2315 2315 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2316 2316 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2317 2317 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2318 2318 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2319 2319 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2320 2320 </style>
2321   <pre class='nx'><span class='nx-comment'># Read instance variable of object obj
2322   </span><span class='nx-comment'># via resolver
  2321 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Read instance variable of object obj
  2322 </span><span class='nx-[namespace tail [nx::self]]'># via resolver
2323 2323 </span>
2324 2324 <span class='nx-keyword'>set</span> <span class='nx-placeholder'>/varName/</span> [<span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>eval</span> {<span class='nx-keyword'>set</span> :<span class='nx-placeholder'>/otherVar/</span>}]</pre></div></div></div></td>
2325 2325 </tr>
2326 2326 <tr>
2327 2327 <td align="left" valign="middle"><div><div class="listingblock">
2328 2328 <div class="content"><style type='text/css'>
2329 2329 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2330 2330 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2331 2331 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2332 2332 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2333 2333 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2334 2334 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2335 2335 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2336 2336 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2337 2337 </style>
2338 2338 <pre class='nx'>... instproc ... {
2339 2339    <span class='nx-placeholder'>/obj/</span> instvar <span class='nx-placeholder'>/varName/</span>
2340 2340    <span class='nx-keyword'>set</span> <span class='nx-placeholder'>/varName/</span> <span class='nx-placeholder'>?value?</span>
2341 2341 }</pre></div></div></div></td>
2342 2342 <td align="left" valign="middle"><div><div class="listingblock">
2343 2343 <div class="content"><style type='text/css'>
2344 2344 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2345 2345 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2346 2346 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2347 2347 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2348 2348 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2349 2349 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2350 2350 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2351 2351 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2352 2352 </style>
2353   <pre class='nx'><span class='nx-comment'># Read instance variable of object /obj/
2354   </span><span class='nx-comment'># via import
  2353 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Read instance variable of object /obj/
  2354 </span><span class='nx-[namespace tail [nx::self]]'># via import
2355 2355 </span>
2356 2356 ... <span class='nx-keyword'>method</span> ... {
2357 2357    ::nx::var import <span class='nx-placeholder'>/obj/</span> <span class='nx-placeholder'>/varName/</span>
2358 2358    <span class='nx-keyword'>set</span> <span class='nx-placeholder'>/varName/</span> <span class='nx-placeholder'>?value?</span>
2359 2359 }</pre></div></div></div></td>
2360 2360 </tr>
2361 2361 <tr>
2362 2362 <td align="left" valign="middle"><div><div class="listingblock">
2363 2363 <div class="content"><style type='text/css'>
2364 2364 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2365 2365 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2366 2366 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2367 2367 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2368 2368 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2369 2369 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2370 2370 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2371 2371 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2372 2372 </style>
2373 2373 <pre class='nx'><span class='nx-placeholder'>/obj/</span> exists varName</pre></div></div></div></td>
2374 2374 <td align="left" valign="middle"><div><div class="listingblock">
2375 2375 <div class="content"><style type='text/css'>
2376 2376 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2377 2377 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2378 2378 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2379 2379 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2380 2380 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2381 2381 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2382 2382 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2383 2383 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2384 2384 </style>
2385   <pre class='nx'><span class='nx-comment'># Test existence of instance variable of
2386   </span><span class='nx-comment'># object obj
  2385 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Test existence of instance variable of
  2386 </span><span class='nx-[namespace tail [nx::self]]'># object obj
2387 2387 </span>
2388 2388 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>eval</span> {<span class='nx-keyword'>info</span> exists :<span class='nx-placeholder'>/varName/</span>}</pre></div></div>
2389 2389 <div class="listingblock">
2390 2390 <div class="content"><style type='text/css'>
2391 2391 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2392 2392 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2393 2393 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2394 2394 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2395 2395 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2396 2396 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2397 2397 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2398 2398 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2399 2399 </style>
2400 2400 <pre class='nx'>::nx::var exists <span class='nx-placeholder'>/obj/</span> <span class='nx-placeholder'>/varName/</span></pre></div></div></div></td>
2401 2401 </tr>
2402 2402 </tbody>
2403 2403 </table>
2404 2404 </div>
2405 2405 </div>
2406 2406 </div>
 
2477 2477 <col width="50%" />
2478 2478 <thead>
2479 2479 <tr>
2480 2480 <th align="left" valign="middle">XOTcl </th>
2481 2481 <th align="left" valign="middle">Next Scripting Language</th>
2482 2482 </tr>
2483 2483 </thead>
2484 2484 <tbody>
2485 2485 <tr>
2486 2486 <td align="left" valign="middle"><div><div class="listingblock">
2487 2487 <div class="content"><style type='text/css'>
2488 2488 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2489 2489 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2490 2490 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2491 2491 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2492 2492 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2493 2493 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2494 2494 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2495 2495 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2496 2496 </style>
2497   <pre class='nx'><span class='nx-comment'># Define class "Foo" with instance
2498   </span><span class='nx-comment'># variables "x" and "y" initialized
2499   </span><span class='nx-comment'># on instance creation. The initialization
2500   </span><span class='nx-comment'># has to be performed in the constructor.
  2497 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Define class "Foo" with instance
  2498 </span><span class='nx-[namespace tail [nx::self]]'># variables "x" and "y" initialized
  2499 </span><span class='nx-[namespace tail [nx::self]]'># on instance creation. The initialization
  2500 </span><span class='nx-[namespace tail [nx::self]]'># has to be performed in the constructor.
2501 2501 </span>
2502 2502 <span class='nx-keyword'>Class</span> Foo
2503 2503 Foo instproc <span class='nx-keyword'>init</span> args {
2504 2504    instvar x y
2505 2505    <span class='nx-keyword'>set</span> x 1
2506 2506    <span class='nx-keyword'>set</span> y 2
2507 2507 }
2508 2508
2509   <span class='nx-comment'># Create instance of the class Foo
  2509 <span class='nx-[namespace tail [nx::self]]'># Create instance of the class Foo
2510 2510 </span>Foo f1
2511 2511
2512   <span class='nx-comment'># Object f1 has instance variables
2513   </span><span class='nx-comment'># x == 1 and y == 2</span></pre></div></div></div></td>
  2512 <span class='nx-[namespace tail [nx::self]]'># Object f1 has instance variables
  2513 </span><span class='nx-[namespace tail [nx::self]]'># x == 1 and y == 2</span></pre></div></div></div></td>
2514 2514 <td align="left" valign="middle"><div><div class="listingblock">
2515 2515 <div class="content"><style type='text/css'>
2516 2516 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2517 2517 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2518 2518 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2519 2519 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2520 2520 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2521 2521 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2522 2522 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2523 2523 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2524 2524 </style>
2525   <pre class='nx'><span class='nx-comment'># Define class "Foo" with instance variables
2526   </span><span class='nx-comment'># "x" and "y" initialized on instance creation.
2527   </span><span class='nx-comment'># The method "variable" is similar in syntax
2528   </span><span class='nx-comment'># to Tcl's "variable" command. During
2529   </span><span class='nx-comment'># instance creation, the variable
2530   </span><span class='nx-comment'># definitions are used for the
2531   </span><span class='nx-comment'># initialization of the variables of the object.
  2525 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Define class "Foo" with instance variables
  2526 </span><span class='nx-[namespace tail [nx::self]]'># "x" and "y" initialized on instance creation.
  2527 </span><span class='nx-[namespace tail [nx::self]]'># The method "variable" is similar in syntax
  2528 </span><span class='nx-[namespace tail [nx::self]]'># to Tcl's "variable" command. During
  2529 </span><span class='nx-[namespace tail [nx::self]]'># instance creation, the variable
  2530 </span><span class='nx-[namespace tail [nx::self]]'># definitions are used for the
  2531 </span><span class='nx-[namespace tail [nx::self]]'># initialization of the variables of the object.
2532 2532 </span>
2533 2533 <span class='nx-keyword'>Class</span> <span class='nx-keyword'>create</span> Foo {
2534 2534   <span class='nx-keyword'>:variable</span> x 1
2535 2535   <span class='nx-keyword'>:variable</span> y 2
2536 2536 }
2537 2537
2538   <span class='nx-comment'># Create instance of the class Foo
  2538 <span class='nx-[namespace tail [nx::self]]'># Create instance of the class Foo
2539 2539 </span>Foo <span class='nx-keyword'>create</span> f1
2540 2540
2541   <span class='nx-comment'># Object f1 has instance variables
2542   </span><span class='nx-comment'># x == 1 and y == 2</span></pre></div></div></div></td>
  2541 <span class='nx-[namespace tail [nx::self]]'># Object f1 has instance variables
  2542 </span><span class='nx-[namespace tail [nx::self]]'># x == 1 and y == 2</span></pre></div></div></div></td>
2543 2543 </tr>
2544 2544 </tbody>
2545 2545 </table>
2546 2546 </div>
2547 2547 <div class="paragraph"><p>While XOTcl follows a procedural way to initialize variables via the
2548 2548 constructor <code>init</code>, NX follows a more declarative approach. Often,
2549 2549 classes have superclasses, which often want to provide their own
2550 2550 instance variables and default values. The declarative approach from
2551 2551 NX solves this via inheritance, while an procedural approach via
2552 2552 assign statements in the constructor requires explicit constructor
2553 2553 calls, which are often error-prone. Certainly, when a user prefers to
2554 2554 assign initial values to instance variables via explicit assign
2555 2555 operations in constructors, this is as ell possible in NX.</p></div>
2556 2556 <div class="paragraph"><p>NX uses the same mechanism to define class variables or object
2557 2557 variables.</p></div>
2558 2558 <div class="tableblock">
2559 2559 <table rules="all"
2560 2560 width="100%"
2561 2561 frame="void"
2562 2562 cellspacing="0" cellpadding="4">
2563 2563 <col width="50%" />
2564 2564 <col width="50%" />
2565 2565 <thead>
2566 2566 <tr>
2567 2567 <th align="left" valign="middle">XOTcl </th>
2568 2568 <th align="left" valign="middle">Next Scripting Language</th>
2569 2569 </tr>
2570 2570 </thead>
2571 2571 <tbody>
2572 2572 <tr>
2573 2573 <td align="left" valign="middle"><div><div class="listingblock">
2574 2574 <div class="content"><style type='text/css'>
2575 2575 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2576 2576 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2577 2577 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2578 2578 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2579 2579 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2580 2580 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2581 2581 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2582 2582 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2583 2583 </style>
2584   <pre class='nx'><span class='nx-comment'># No syntactic support for creating
2585   </span><span class='nx-comment'># class variables</span></pre></div></div></div></td>
  2584 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># No syntactic support for creating
  2585 </span><span class='nx-[namespace tail [nx::self]]'># class variables</span></pre></div></div></div></td>
2586 2586 <td align="left" valign="middle"><div><div class="listingblock">
2587 2587 <div class="content"><style type='text/css'>
2588 2588 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2589 2589 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2590 2590 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2591 2591 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2592 2592 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2593 2593 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2594 2594 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2595 2595 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2596 2596 </style>
2597 2597 <pre class='nx'>
2598   <span class='nx-comment'># Define a object variable "V" with value 100 and
2599   </span><span class='nx-comment'># an instance variable "x". "V" is defined for the
2600   </span><span class='nx-comment'># class object Foo, "x" is defined in the
2601   </span><span class='nx-comment'># instances of the class. "object variable" works
2602   </span><span class='nx-comment'># similar to "object method".
  2598 <span class='nx-[namespace tail [nx::self]]'># Define a object variable "V" with value 100 and
  2599 </span><span class='nx-[namespace tail [nx::self]]'># an instance variable "x". "V" is defined for the
  2600 </span><span class='nx-[namespace tail [nx::self]]'># class object Foo, "x" is defined in the
  2601 </span><span class='nx-[namespace tail [nx::self]]'># instances of the class. "object variable" works
  2602 </span><span class='nx-[namespace tail [nx::self]]'># similar to "object method".
2603 2603 </span>
2604 2604 <span class='nx-keyword'>Class</span> <span class='nx-keyword'>create</span> Foo {
2605 2605   <span class='nx-keyword'>:object</span> <span class='nx-keyword'>variable</span> V 100
2606 2606   <span class='nx-keyword'>:variable</span> x 1
2607 2607 }</pre></div></div></div></td>
2608 2608 </tr>
2609 2609 </tbody>
2610 2610 </table>
2611 2611 </div>
2612 2612 <div class="paragraph"><p>In the next step, we define configurable instance variables which we
2613 2613 call <em>properties</em> in NX.</p></div>
2614 2614 <div class="paragraph"><p>XOTcl uses the method <code>parameter</code> is a shortcut for creating multiple
2615 2615 configurable variables with automically created accessors (methods for
2616 2616 reading and writing of the variables). In NX, the prefered way to
2617 2617 create configurable variables is to use the method <code>property</code>. The
2618 2618 method <code>property</code> in NX is similar to <code>variable</code>, but makes the
2619 2619 variables configurable, which means that</p></div>
2620 2620 <div class="olist arabic"><ol class="arabic">
2621 2621 <li>
2622 2622 <p>
 
2645 2645 <col width="50%" />
2646 2646 <thead>
2647 2647 <tr>
2648 2648 <th align="left" valign="middle">XOTcl </th>
2649 2649 <th align="left" valign="middle">Next Scripting Language</th>
2650 2650 </tr>
2651 2651 </thead>
2652 2652 <tbody>
2653 2653 <tr>
2654 2654 <td align="left" valign="middle"><div><div class="listingblock">
2655 2655 <div class="content"><style type='text/css'>
2656 2656 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2657 2657 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2658 2658 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2659 2659 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2660 2660 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2661 2661 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2662 2662 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2663 2663 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2664 2664 </style>
2665   <pre class='nx'><span class='nx-comment'># Parameters specified as a list
2666   </span><span class='nx-comment'># (short form); parameter
2667   </span><span class='nx-comment'># "a" has no default, "b" has default "1"
  2665 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Parameters specified as a list
  2666 </span><span class='nx-[namespace tail [nx::self]]'># (short form); parameter
  2667 </span><span class='nx-[namespace tail [nx::self]]'># "a" has no default, "b" has default "1"
2668 2668 </span>
2669 2669 <span class='nx-keyword'>Class</span> Foo -parameter {a {b 1}}
2670 2670
2671   <span class='nx-comment'># Create instance of the class Foo
  2671 <span class='nx-[namespace tail [nx::self]]'># Create instance of the class Foo
2672 2672 </span>Foo f1 -a 0
2673 2673
2674   <span class='nx-comment'># Object f1 has instance variables
2675   </span><span class='nx-comment'># a == 0 and b == 1
  2674 <span class='nx-[namespace tail [nx::self]]'># Object f1 has instance variables
  2675 </span><span class='nx-[namespace tail [nx::self]]'># a == 0 and b == 1
2676 2676 </span>
2677   <span class='nx-comment'># XOTcl registers automatically accessors
2678   </span><span class='nx-comment'># for the parameters. Use the accessor
2679   </span><span class='nx-comment'># "b" to output the value of variable "b"
  2677 <span class='nx-[namespace tail [nx::self]]'># XOTcl registers automatically accessors
  2678 </span><span class='nx-[namespace tail [nx::self]]'># for the parameters. Use the accessor
  2679 </span><span class='nx-[namespace tail [nx::self]]'># "b" to output the value of variable "b"
2680 2680 </span><span class='nx-keyword'>puts</span> [f1 b]
2681 2681
2682   <span class='nx-comment'># Use the setter to alter value of
2683   </span><span class='nx-comment'># instance variable "b"
  2682 <span class='nx-[namespace tail [nx::self]]'># Use the setter to alter value of
  2683 </span><span class='nx-[namespace tail [nx::self]]'># instance variable "b"
2684 2684 </span>f1 b 100</pre></div></div></div></td>
2685 2685 <td align="left" valign="middle"><div><div class="listingblock">
2686 2686 <div class="content"><style type='text/css'>
2687 2687 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2688 2688 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2689 2689 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2690 2690 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2691 2691 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2692 2692 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2693 2693 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2694 2694 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2695 2695 </style>
2696   <pre class='nx'><span class='nx-comment'># Define property "a" and "b". The
2697   </span><span class='nx-comment'># property "a" has no default, "b" has
2698   </span><span class='nx-comment'># default value "1"
  2696 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Define property "a" and "b". The
  2697 </span><span class='nx-[namespace tail [nx::self]]'># property "a" has no default, "b" has
  2698 </span><span class='nx-[namespace tail [nx::self]]'># default value "1"
2699 2699 </span>
2700 2700 <span class='nx-keyword'>Class</span> <span class='nx-keyword'>create</span> Foo {
2701 2701   <span class='nx-keyword'>:property</span> a
2702 2702   <span class='nx-keyword'>:property</span> {b 1}
2703 2703 }
2704 2704
2705   <span class='nx-comment'># Create instance of the class Foo
  2705 <span class='nx-[namespace tail [nx::self]]'># Create instance of the class Foo
2706 2706 </span>Foo <span class='nx-keyword'>create</span> f1 -a 0
2707 2707
2708   <span class='nx-comment'># Object f1 has instance variables
2709   </span><span class='nx-comment'># a == 0 and b == 1
  2708 <span class='nx-[namespace tail [nx::self]]'># Object f1 has instance variables
  2709 </span><span class='nx-[namespace tail [nx::self]]'># a == 0 and b == 1
2710 2710 </span>
2711   <span class='nx-comment'># Use the method "cget" to query the value
2712   </span><span class='nx-comment'># of a configuration parameter
  2711 <span class='nx-[namespace tail [nx::self]]'># Use the method "cget" to query the value
  2712 </span><span class='nx-[namespace tail [nx::self]]'># of a configuration parameter
2713 2713 </span><span class='nx-keyword'>puts</span> [f1 <span class='nx-keyword'>cget</span> -b]
2714 2714
2715   <span class='nx-comment'># Use the method "configure" to alter the
2716   </span><span class='nx-comment'># value of instance variable "b"
  2715 <span class='nx-[namespace tail [nx::self]]'># Use the method "configure" to alter the
  2716 </span><span class='nx-[namespace tail [nx::self]]'># value of instance variable "b"
2717 2717 </span>f1 <span class='nx-keyword'>configure</span> -b 100</pre></div></div></div></td>
2718 2718 </tr>
2719 2719 </tbody>
2720 2720 </table>
2721 2721 </div>
2722 2722 <div class="paragraph"><p>In general, NX allows to create variables and properties with and
2723 2723 without accessor methods. The created accessor methods might be
2724 2724 <code>public</code>, <code>protected</code> or <code>public</code>. When the value <code>none</code> is provided
2725 2725 to <code>-accessor</code>, no accessor will be created. This is actually the
2726 2726 default in NX. In order to change the default behavior in NX, one can use
2727 2727 <code>::nx::configure defaultAccessor none|public|protected|private</code>.</p></div>
2728 2728 <div class="tableblock">
2729 2729 <table rules="all"
2730 2730 width="100%"
2731 2731 frame="void"
2732 2732 cellspacing="0" cellpadding="4">
2733 2733 <col width="50%" />
2734 2734 <col width="50%" />
2735 2735 <thead>
2736 2736 <tr>
2737 2737 <th align="left" valign="middle">XOTcl </th>
2738 2738 <th align="left" valign="middle">Next Scripting Language</th>
2739 2739 </tr>
2740 2740 </thead>
2741 2741 <tbody>
2742 2742 <tr>
2743 2743 <td align="left" valign="middle"><div><div class="listingblock">
2744 2744 <div class="content"><style type='text/css'>
2745 2745 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2746 2746 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2747 2747 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2748 2748 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2749 2749 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2750 2750 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2751 2751 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2752 2752 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2753 2753 </style>
2754   <pre class='nx'><span class='nx-comment'># "parameter" creates always accessor
2755   </span><span class='nx-comment'># methods, accessor methods are
2756   </span><span class='nx-comment'># always public, no "cget" is available.
  2754 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># "parameter" creates always accessor
  2755 </span><span class='nx-[namespace tail [nx::self]]'># methods, accessor methods are
  2756 </span><span class='nx-[namespace tail [nx::self]]'># always public, no "cget" is available.
2757 2757 </span>
2758 2758 <span class='nx-keyword'>Class</span> <span class='nx-keyword'>create</span> Foo -parameter {a {b1}}
2759 2759
2760   <span class='nx-comment'># Use the accessor method to query
2761   </span><span class='nx-comment'># the value of a configuration parameter
  2760 <span class='nx-[namespace tail [nx::self]]'># Use the accessor method to query
  2761 </span><span class='nx-[namespace tail [nx::self]]'># the value of a configuration parameter
2762 2762 </span><span class='nx-keyword'>puts</span> [f1 b]
2763 2763
2764   <span class='nx-comment'># Use the accessor method to set the
2765   </span><span class='nx-comment'># value of instance variable "a"
  2764 <span class='nx-[namespace tail [nx::self]]'># Use the accessor method to set the
  2765 </span><span class='nx-[namespace tail [nx::self]]'># value of instance variable "a"
2766 2766 </span>f1 a 100
2767 2767
2768   <span class='nx-comment'># Use the accessor method to unset the
2769   </span><span class='nx-comment'># value of instance variable "a" n.a. via
2770   </span><span class='nx-comment'># accessor</span></pre></div></div></div></td>
  2768 <span class='nx-[namespace tail [nx::self]]'># Use the accessor method to unset the
  2769 </span><span class='nx-[namespace tail [nx::self]]'># value of instance variable "a" n.a. via
  2770 </span><span class='nx-[namespace tail [nx::self]]'># accessor</span></pre></div></div></div></td>
2771 2771 <td align="left" valign="middle"><div><div class="listingblock">
2772 2772 <div class="content"><style type='text/css'>
2773 2773 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2774 2774 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2775 2775 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2776 2776 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2777 2777 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2778 2778 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2779 2779 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2780 2780 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2781 2781 </style>
2782   <pre class='nx'><span class='nx-comment'># Define property "a" and "b". The
2783   </span><span class='nx-comment'># property "a" has no default, "b" has
2784   </span><span class='nx-comment'># default value "1"
  2782 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Define property "a" and "b". The
  2783 </span><span class='nx-[namespace tail [nx::self]]'># property "a" has no default, "b" has
  2784 </span><span class='nx-[namespace tail [nx::self]]'># default value "1"
2785 2785 </span>
2786 2786 <span class='nx-keyword'>Class</span> <span class='nx-keyword'>create</span> Foo {
2787 2787   <span class='nx-keyword'>:variable</span> -accessor <span class='nx-keyword'>public</span> a
2788 2788   <span class='nx-keyword'>:property</span> -accessor <span class='nx-keyword'>public</span> {b 1}
2789 2789 }
2790 2790
2791   <span class='nx-comment'># Use the accessor method to query
2792   </span><span class='nx-comment'># the value of a configuration parameter
  2791 <span class='nx-[namespace tail [nx::self]]'># Use the accessor method to query
  2792 </span><span class='nx-[namespace tail [nx::self]]'># the value of a configuration parameter
2793 2793 </span><span class='nx-keyword'>puts</span> [f1 b get]
2794 2794
2795   <span class='nx-comment'># Use the accessor method to set the
2796   </span><span class='nx-comment'># value of instance variable "a"
  2795 <span class='nx-[namespace tail [nx::self]]'># Use the accessor method to set the
  2796 </span><span class='nx-[namespace tail [nx::self]]'># value of instance variable "a"
2797 2797 </span>f1 a <span class='nx-keyword'>set</span> 100
2798 2798
2799   <span class='nx-comment'># Use the accessor method to unset the
2800   </span><span class='nx-comment'># value of instance variable "a"
  2799 <span class='nx-[namespace tail [nx::self]]'># Use the accessor method to unset the
  2800 </span><span class='nx-[namespace tail [nx::self]]'># value of instance variable "a"
2801 2801 </span>f1 a <span class='nx-keyword'>unset</span></pre></div></div></div></td>
2802 2802 </tr>
2803 2803 </tbody>
2804 2804 </table>
2805 2805 </div>
2806 2806 <div class="paragraph"><p>Similar to <code>variable</code>, properties can be defined in NX on the class
2807 2807 and on the object level.</p></div>
2808 2808 <div class="tableblock">
2809 2809 <table rules="all"
2810 2810 width="100%"
2811 2811 frame="void"
2812 2812 cellspacing="0" cellpadding="4">
2813 2813 <col width="50%" />
2814 2814 <col width="50%" />
2815 2815 <thead>
2816 2816 <tr>
2817 2817 <th align="left" valign="middle">XOTcl </th>
2818 2818 <th align="left" valign="middle">Next Scripting Language</th>
2819 2819 </tr>
2820 2820 </thead>
2821 2821 <tbody>
2822 2822 <tr>
2823 2823 <td align="left" valign="middle"><div><div class="listingblock">
2824 2824 <div class="content"><style type='text/css'>
2825 2825 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2826 2826 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2827 2827 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2828 2828 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2829 2829 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2830 2830 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2831 2831 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2832 2832 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2833 2833 </style>
2834   <pre class='nx'><span class='nx-comment'># XOTcl provides no means to define
2835   </span><span class='nx-comment'># configurable variables at the object
2836   </span><span class='nx-comment'># level</span></pre></div></div></div></td>
  2834 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># XOTcl provides no means to define
  2835 </span><span class='nx-[namespace tail [nx::self]]'># configurable variables at the object
  2836 </span><span class='nx-[namespace tail [nx::self]]'># level</span></pre></div></div></div></td>
2837 2837 <td align="left" valign="middle"><div><div class="listingblock">
2838 2838 <div class="content"><style type='text/css'>
2839 2839 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2840 2840 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2841 2841 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2842 2842 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2843 2843 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2844 2844 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2845 2845 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2846 2846 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2847 2847 </style>
2848   <pre class='nx'><span class='nx-comment'># Define class with a property for the class object
2849   </span><span class='nx-comment'># named "cp". This is similar to "static variables"
2850   </span><span class='nx-comment'># in some other object-oriented programming
2851   </span><span class='nx-comment'># languages.
  2848 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Define class with a property for the class object
  2849 </span><span class='nx-[namespace tail [nx::self]]'># named "cp". This is similar to "static variables"
  2850 </span><span class='nx-[namespace tail [nx::self]]'># in some other object-oriented programming
  2851 </span><span class='nx-[namespace tail [nx::self]]'># languages.
2852 2852 </span>
2853 2853 <span class='nx-keyword'>Class</span> <span class='nx-keyword'>create</span> Foo {
2854 2854   ...
2855 2855   <span class='nx-keyword'>:object</span> <span class='nx-keyword'>property</span> cp 101
2856 2856 }
2857 2857
2858   <span class='nx-comment'># Define object property "op"
  2858 <span class='nx-[namespace tail [nx::self]]'># Define object property "op"
2859 2859 </span>
2860 2860 <span class='nx-keyword'>Object</span> <span class='nx-keyword'>create</span> o {
2861 2861   <span class='nx-keyword'>:object</span> <span class='nx-keyword'>property</span> op 102
2862 2862 }</pre></div></div></div></td>
2863 2863 </tr>
2864 2864 </tbody>
2865 2865 </table>
2866 2866 </div>
2867 2867 <div class="paragraph"><p>NX supports <em>value constraints</em> (value-checkers) for object and method
2868 2868 parameters in an orthogonal manner. NX provides a predefined set of
2869 2869 value checkers, which can be extended by the application developer.
2870 2870 In NX, the <em>value checking is optional</em>. This means that it is possible to
2871 2871 develop e.g. which a large amount of value-checking and deploy the
2872 2872 script with value checking turned off, if the script is highly
2873 2873 performance sensitive.</p></div>
2874 2874 <div class="tableblock">
2875 2875 <table rules="all"
2876 2876 width="100%"
2877 2877 frame="void"
2878 2878 cellspacing="0" cellpadding="4">
2879 2879 <col width="50%" />
2880 2880 <col width="50%" />
2881 2881 <thead>
2882 2882 <tr>
2883 2883 <th align="left" valign="middle">XOTcl </th>
2884 2884 <th align="left" valign="middle">Next Scripting Language</th>
2885 2885 </tr>
2886 2886 </thead>
2887 2887 <tbody>
2888 2888 <tr>
2889 2889 <td align="left" valign="middle"><div><div class="listingblock">
2890 2890 <div class="content"><style type='text/css'>
2891 2891 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2892 2892 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2893 2893 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2894 2894 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2895 2895 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2896 2896 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2897 2897 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2898 2898 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2899 2899 </style>
2900   <pre class='nx'><span class='nx-comment'># No value constraints for
2901   </span><span class='nx-comment'># parameter available</span></pre></div></div></div></td>
  2900 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># No value constraints for
  2901 </span><span class='nx-[namespace tail [nx::self]]'># parameter available</span></pre></div></div></div></td>
2902 2902 <td align="left" valign="middle"><div><div class="listingblock">
2903 2903 <div class="content"><style type='text/css'>
2904 2904 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2905 2905 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2906 2906 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2907 2907 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2908 2908 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2909 2909 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2910 2910 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2911 2911 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2912 2912 </style>
2913   <pre class='nx'><span class='nx-comment'># Predefined value constraints:
2914   </span><span class='nx-comment'>#    object, class, alnum, alpha, ascii, boolean,
2915   </span><span class='nx-comment'>#    control, digit, double, false, graph, integer,
2916   </span><span class='nx-comment'>#    lower, parameter, print, punct, space, true,
2917   </span><span class='nx-comment'>#    upper, wordchar, xdigit
2918   </span><span class='nx-comment'>#
2919   </span><span class='nx-comment'># User defined value constraints are possible.
2920   </span><span class='nx-comment'># All parameter value checkers can be turned on
2921   </span><span class='nx-comment'># and off at runtime.
2922   </span><span class='nx-comment'>#
2923   </span><span class='nx-comment'># Define a required boolean property "a"
2924   </span><span class='nx-comment'># and an integer property "b" with a default.
2925   </span><span class='nx-comment'># The first definition uses "properties",
2926   </span><span class='nx-comment'># the second definition uses multiple
2927   </span><span class='nx-comment'># "property" statements.
  2913 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Predefined value constraints:
  2914 </span><span class='nx-[namespace tail [nx::self]]'>#    object, class, alnum, alpha, ascii, boolean,
  2915 </span><span class='nx-[namespace tail [nx::self]]'>#    control, digit, double, false, graph, integer,
  2916 </span><span class='nx-[namespace tail [nx::self]]'>#    lower, parameter, print, punct, space, true,
  2917 </span><span class='nx-[namespace tail [nx::self]]'>#    upper, wordchar, xdigit
  2918 </span><span class='nx-[namespace tail [nx::self]]'>#
  2919 </span><span class='nx-[namespace tail [nx::self]]'># User defined value constraints are possible.
  2920 </span><span class='nx-[namespace tail [nx::self]]'># All parameter value checkers can be turned on
  2921 </span><span class='nx-[namespace tail [nx::self]]'># and off at runtime.
  2922 </span><span class='nx-[namespace tail [nx::self]]'>#
  2923 </span><span class='nx-[namespace tail [nx::self]]'># Define a required boolean property "a"
  2924 </span><span class='nx-[namespace tail [nx::self]]'># and an integer property "b" with a default.
  2925 </span><span class='nx-[namespace tail [nx::self]]'># The first definition uses "properties",
  2926 </span><span class='nx-[namespace tail [nx::self]]'># the second definition uses multiple
  2927 </span><span class='nx-[namespace tail [nx::self]]'># "property" statements.
2928 2928 </span>
2929 2929 <span class='nx-keyword'>Class</span> <span class='nx-keyword'>create</span> Foo -properties {
2930 2930    a:boolean
2931 2931    {b:integer 1}
2932 2932 }</pre></div></div>
2933 2933 <div class="listingblock">
2934 2934 <div class="content"><style type='text/css'>
2935 2935 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2936 2936 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2937 2937 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2938 2938 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2939 2939 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2940 2940 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2941 2941 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2942 2942 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2943 2943 </style>
2944 2944 <pre class='nx'><span class='nx-keyword'>Class</span> <span class='nx-keyword'>create</span> Foo {
2945 2945    <span class='nx-keyword'>:property</span> a:boolean
2946 2946    <span class='nx-keyword'>:property</span> {b:integer 1}
2947 2947 }</pre></div></div></div></td>
 
2965 2965 <col width="50%" />
2966 2966 <thead>
2967 2967 <tr>
2968 2968 <th align="left" valign="middle">XOTcl </th>
2969 2969 <th align="left" valign="middle">Next Scripting Language</th>
2970 2970 </tr>
2971 2971 </thead>
2972 2972 <tbody>
2973 2973 <tr>
2974 2974 <td align="left" valign="middle"><div><div class="listingblock">
2975 2975 <div class="content"><style type='text/css'>
2976 2976 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2977 2977 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2978 2978 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2979 2979 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2980 2980 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2981 2981 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2982 2982 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2983 2983 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2984 2984 </style>
2985   <pre class='nx'><span class='nx-comment'># Required parameter not available</span></pre></div></div></div></td>
  2985 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Required parameter not available</span></pre></div></div></div></td>
2986 2986 <td align="left" valign="middle"><div><div class="listingblock">
2987 2987 <div class="content"><style type='text/css'>
2988 2988 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
2989 2989 table.nx        {border-collapse: collapse; border-spacing: 3px;}
2990 2990 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
2991 2991 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
2992 2992 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
2993 2993 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
2994 2994 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
2995 2995 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
2996 2996 </style>
2997   <pre class='nx'><span class='nx-comment'># Required parameter:
2998   </span><span class='nx-comment'># Define a required property "a" and a
2999   </span><span class='nx-comment'># required boolean property "b"
  2997 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Required parameter:
  2998 </span><span class='nx-[namespace tail [nx::self]]'># Define a required property "a" and a
  2999 </span><span class='nx-[namespace tail [nx::self]]'># required boolean property "b"
3000 3000 </span>
3001 3001 <span class='nx-keyword'>Class</span> <span class='nx-keyword'>create</span> Foo -properties {
3002 3002    a:required
3003 3003    b:boolean,required
3004 3004 }</pre></div></div>
3005 3005 <div class="listingblock">
3006 3006 <div class="content"><style type='text/css'>
3007 3007 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
3008 3008 table.nx        {border-collapse: collapse; border-spacing: 3px;}
3009 3009 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
3010 3010 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
3011 3011 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
3012 3012 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
3013 3013 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
3014 3014 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
3015 3015 </style>
3016 3016 <pre class='nx'>
3017 3017 <span class='nx-keyword'>Class</span> <span class='nx-keyword'>create</span> Foo {
3018 3018    <span class='nx-keyword'>:property</span> a:required
3019 3019    <span class='nx-keyword'>:property</span> b:boolean,required
 
3036 3036 <col width="50%" />
3037 3037 <thead>
3038 3038 <tr>
3039 3039 <th align="left" valign="middle">XOTcl </th>
3040 3040 <th align="left" valign="middle">Next Scripting Language</th>
3041 3041 </tr>
3042 3042 </thead>
3043 3043 <tbody>
3044 3044 <tr>
3045 3045 <td align="left" valign="middle"><div><div class="listingblock">
3046 3046 <div class="content"><style type='text/css'>
3047 3047 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
3048 3048 table.nx        {border-collapse: collapse; border-spacing: 3px;}
3049 3049 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
3050 3050 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
3051 3051 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
3052 3052 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
3053 3053 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
3054 3054 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
3055 3055 </style>
3056   <pre class='nx'><span class='nx-comment'># Multiplicity for parameter
3057   </span><span class='nx-comment'># not available</span></pre></div></div></div></td>
  3056 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Multiplicity for parameter
  3057 </span><span class='nx-[namespace tail [nx::self]]'># not available</span></pre></div></div></div></td>
3058 3058 <td align="left" valign="middle"><div><div class="listingblock">
3059 3059 <div class="content"><style type='text/css'>
3060 3060 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
3061 3061 table.nx        {border-collapse: collapse; border-spacing: 3px;}
3062 3062 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
3063 3063 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
3064 3064 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
3065 3065 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
3066 3066 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
3067 3067 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
3068 3068 </style>
3069   <pre class='nx'><span class='nx-comment'># Parameter with multiplicity
3070   </span><span class='nx-comment'>#   ints is a list of integers, with default
3071   </span><span class='nx-comment'>#   objs is a non-empty list of objects
3072   </span><span class='nx-comment'>#   obj is a single object, maybe empty
  3069 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Parameter with multiplicity
  3070 </span><span class='nx-[namespace tail [nx::self]]'>#   ints is a list of integers, with default
  3071 </span><span class='nx-[namespace tail [nx::self]]'>#   objs is a non-empty list of objects
  3072 </span><span class='nx-[namespace tail [nx::self]]'>#   obj is a single object, maybe empty
3073 3073 </span>
3074 3074 <span class='nx-keyword'>Class</span> <span class='nx-keyword'>create</span> Foo -properties {
3075 3075   {ints:integer,0..n <span class='nx-string'>""</span>}
3076 3076    objs<span class='nx-keyword'>:object</span>,1..n
3077 3077    obj<span class='nx-keyword'>:object</span>,0..1
3078 3078 }</pre></div></div>
3079 3079 <div class="listingblock">
3080 3080 <div class="content"><style type='text/css'>
3081 3081 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
3082 3082 table.nx        {border-collapse: collapse; border-spacing: 3px;}
3083 3083 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
3084 3084 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
3085 3085 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
3086 3086 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
3087 3087 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
3088 3088 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
3089 3089 </style>
3090 3090 <pre class='nx'><span class='nx-keyword'>Class</span> <span class='nx-keyword'>create</span> Foo {
3091 3091   <span class='nx-keyword'>:property</span> {ints:integer,0..n <span class='nx-string'>""</span>}
3092 3092   <span class='nx-keyword'>:property</span> objs<span class='nx-keyword'>:object</span>,1..n
 
3131 3131 <col width="50%" />
3132 3132 <thead>
3133 3133 <tr>
3134 3134 <th align="left" valign="middle">XOTcl </th>
3135 3135 <th align="left" valign="middle">Next Scripting Language</th>
3136 3136 </tr>
3137 3137 </thead>
3138 3138 <tbody>
3139 3139 <tr>
3140 3140 <td align="left" valign="middle"><div><div class="listingblock">
3141 3141 <div class="content"><style type='text/css'>
3142 3142 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
3143 3143 table.nx        {border-collapse: collapse; border-spacing: 3px;}
3144 3144 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
3145 3145 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
3146 3146 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
3147 3147 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
3148 3148 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
3149 3149 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
3150 3150 </style>
3151   <pre class='nx'><span class='nx-comment'># Define parameters via slots
  3151 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Define parameters via slots
3152 3152 </span>
3153 3153 <span class='nx-keyword'>Class</span> Foo -slots {
3154 3154    <span class='nx-keyword'>Attribute</span> a
3155 3155    <span class='nx-keyword'>Attribute</span> b -default 1
3156 3156 }
3157 3157
3158   <span class='nx-comment'># Create instance of the class Foo
3159   </span><span class='nx-comment'># and provide a value for instance
3160   </span><span class='nx-comment'># variable "a"
  3158 <span class='nx-[namespace tail [nx::self]]'># Create instance of the class Foo
  3159 </span><span class='nx-[namespace tail [nx::self]]'># and provide a value for instance
  3160 </span><span class='nx-[namespace tail [nx::self]]'># variable "a"
3161 3161 </span>Foo f1 -a 0
3162 3162
3163   <span class='nx-comment'># Object f1 has a == 0 and b == 1</span></pre></div></div></div></td>
  3163 <span class='nx-[namespace tail [nx::self]]'># Object f1 has a == 0 and b == 1</span></pre></div></div></div></td>
3164 3164 <td align="left" valign="middle"><div><div class="listingblock">
3165 3165 <div class="content"><style type='text/css'>
3166 3166 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
3167 3167 table.nx        {border-collapse: collapse; border-spacing: 3px;}
3168 3168 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
3169 3169 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
3170 3170 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
3171 3171 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
3172 3172 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
3173 3173 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
3174 3174 </style>
3175   <pre class='nx'><span class='nx-comment'># Configurable parameters specified via the
3176   </span><span class='nx-comment'># method "property" (supports method
3177   </span><span class='nx-comment'># modifiers and scripted configuration;
3178   </span><span class='nx-comment'># see below)
  3175 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Configurable parameters specified via the
  3176 </span><span class='nx-[namespace tail [nx::self]]'># method "property" (supports method
  3177 </span><span class='nx-[namespace tail [nx::self]]'># modifiers and scripted configuration;
  3178 </span><span class='nx-[namespace tail [nx::self]]'># see below)
3179 3179 </span>
3180 3180 <span class='nx-keyword'>Class</span> <span class='nx-keyword'>create</span> Foo {
3181 3181    <span class='nx-keyword'>:property</span> a
3182 3182    <span class='nx-keyword'>:property</span> {b 1}
3183 3183 }
3184 3184
3185   <span class='nx-comment'># Create instance of the class Foo and
3186   </span><span class='nx-comment'># provide a value for instance variable "a"
  3185 <span class='nx-[namespace tail [nx::self]]'># Create instance of the class Foo and
  3186 </span><span class='nx-[namespace tail [nx::self]]'># provide a value for instance variable "a"
3187 3187 </span>Foo <span class='nx-keyword'>create</span> f1 -a 0
3188 3188
3189   <span class='nx-comment'># Object f1 has a == 0 and b == 1</span></pre></div></div></div></td>
  3189 <span class='nx-[namespace tail [nx::self]]'># Object f1 has a == 0 and b == 1</span></pre></div></div></div></td>
3190 3190 </tr>
3191 3191 </tbody>
3192 3192 </table>
3193 3193 </div>
3194 3194 <div class="paragraph"><p>Since the slots are objects, the slot objects can be configured and
3195 3195 parameterized like every other object in NX. Slot objects can be
3196 3196 provided with a scripted initialization as well. We show first the
3197 3197 definition of properties simliar to the functionality provided as well
3198 3198 by XOTcl and show afterwards how to use value constraints, optional
3199 3199 parameters, etc. in NX.</p></div>
3200 3200 <div class="tableblock">
3201 3201 <table rules="all"
3202 3202 width="100%"
3203 3203 frame="void"
3204 3204 cellspacing="0" cellpadding="4">
3205 3205 <col width="50%" />
3206 3206 <col width="50%" />
3207 3207 <thead>
3208 3208 <tr>
3209 3209 <th align="left" valign="middle">XOTcl </th>
3210 3210 <th align="left" valign="middle">Next Scripting Language</th>
3211 3211 </tr>
3212 3212 </thead>
3213 3213 <tbody>
3214 3214 <tr>
3215 3215 <td align="left" valign="middle"><div><div class="listingblock">
3216 3216 <div class="content"><style type='text/css'>
3217 3217 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
3218 3218 table.nx        {border-collapse: collapse; border-spacing: 3px;}
3219 3219 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
3220 3220 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
3221 3221 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
3222 3222 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
3223 3223 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
3224 3224 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
3225 3225 </style>
3226   <pre class='nx'><span class='nx-comment'># Define parameter with an an
3227   </span><span class='nx-comment'># attribute-specific type checker
  3226 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Define parameter with an an
  3227 </span><span class='nx-[namespace tail [nx::self]]'># attribute-specific type checker
3228 3228 </span>
3229 3229 <span class='nx-keyword'>Class</span> Person -slots {
3230 3230   <span class='nx-keyword'>Attribute</span> <span class='nx-keyword'>create</span> sex -type <span class='nx-string'>"sex"</span> {
3231 3231     <span class='nx-keyword'>my</span> <span class='nx-keyword'>proc</span> type=sex {name value} {
3232         <span class='nx-keyword'>switch</span> -glob <span class='nx-variable'>$value</span> {
  3232       <span class='nx-keyword'>switch</span> -glob <span class='nx-[namespace tail [nx::self]]'>$value</span> {
3233 3233         m* {<span class='nx-keyword'>return</span> m}
3234 3234         f* {<span class='nx-keyword'>return</span> f}
3235 3235         default {
3236 3236           <span class='nx-keyword'>error</span> <span class='nx-string'>"expected sex but got $value"</span>
3237 3237         }
3238 3238       }
3239 3239     }
3240 3240   }
3241 3241 }</pre></div></div></div></td>
3242 3242 <td align="left" valign="middle"><div><div class="listingblock">
3243 3243 <div class="content"><style type='text/css'>
3244 3244 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
3245 3245 table.nx        {border-collapse: collapse; border-spacing: 3px;}
3246 3246 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
3247 3247 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
3248 3248 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
3249 3249 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
3250 3250 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
3251 3251 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
3252 3252 </style>
3253   <pre class='nx'><span class='nx-comment'># Configure parameter with scripted
3254   </span><span class='nx-comment'># definition (init-block), defining a
3255   </span><span class='nx-comment'># property specific type checker
  3253 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Configure parameter with scripted
  3254 </span><span class='nx-[namespace tail [nx::self]]'># definition (init-block), defining a
  3255 </span><span class='nx-[namespace tail [nx::self]]'># property specific type checker
3256 3256 </span>
3257 3257 <span class='nx-keyword'>Class</span> <span class='nx-keyword'>create</span> Person {
3258 3258     <span class='nx-keyword'>:property</span> -accessor <span class='nx-keyword'>public</span> sex:sex,convert {
3259 3259
3260         <span class='nx-comment'># define a converter to standardize representation
  3260       <span class='nx-[namespace tail [nx::self]]'># define a converter to standardize representation
3261 3261 </span>      <span class='nx-keyword'>:object</span> <span class='nx-keyword'>method</span> type=sex {name value} {
3262           <span class='nx-keyword'>switch</span> -glob <span class='nx-variable'>$value</span> {
  3262         <span class='nx-keyword'>switch</span> -glob <span class='nx-[namespace tail [nx::self]]'>$value</span> {
3263 3263           m* {<span class='nx-keyword'>return</span> m}
3264 3264           f* {<span class='nx-keyword'>return</span> f}
3265 3265           default {<span class='nx-keyword'>error</span> <span class='nx-string'>"expected sex but got $value"</span>}
3266 3266         }
3267 3267       }
3268 3268
3269 3269     }
3270 3270 }</pre></div></div></div></td>
3271 3271 </tr>
3272 3272 </tbody>
3273 3273 </table>
3274 3274 </div>
3275 3275 <div class="paragraph"><p>The parameters provided by a class for the initialization of
3276 3276 instances can be introspected via querying the parameters
3277 3277 of the method create: <code>/cls/ info lookup parameters create</code>
3278 3278 (see <a href="#info_configure_parameter">[info_configure_parameter]</a>).</p></div>
3279 3279 </div>
3280 3280 <div class="sect3">
3281 3281 <h4 id="_delete_variable_handlers">2.4.2. Delete Variable Handlers</h4>
3282 3282 <div class="tableblock">
 
3288 3288 <col width="50%" />
3289 3289 <thead>
3290 3290 <tr>
3291 3291 <th align="left" valign="middle">XOTcl </th>
3292 3292 <th align="left" valign="middle">Next Scripting Language</th>
3293 3293 </tr>
3294 3294 </thead>
3295 3295 <tbody>
3296 3296 <tr>
3297 3297 <td align="left" valign="middle"><div><div class="listingblock">
3298 3298 <div class="content"><style type='text/css'>
3299 3299 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
3300 3300 table.nx        {border-collapse: collapse; border-spacing: 3px;}
3301 3301 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
3302 3302 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
3303 3303 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
3304 3304 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
3305 3305 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
3306 3306 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
3307 3307 </style>
3308   <pre class='nx'><span class='nx-comment'># No syntactic support for deleting
3309   </span><span class='nx-comment'># variable handlers</span></pre></div></div></div></td>
  3308 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># No syntactic support for deleting
  3309 </span><span class='nx-[namespace tail [nx::self]]'># variable handlers</span></pre></div></div></div></td>
3310 3310 <td align="left" valign="middle"><div><div class="listingblock">
3311 3311 <div class="content"><style type='text/css'>
3312 3312 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
3313 3313 table.nx        {border-collapse: collapse; border-spacing: 3px;}
3314 3314 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
3315 3315 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
3316 3316 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
3317 3317 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
3318 3318 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
3319 3319 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
3320 3320 </style>
3321   <pre class='nx'><span class='nx-comment'># Like deletion of Methods:
3322   </span><span class='nx-comment'># Delete on the object, where the
3323   </span><span class='nx-comment'># variable handler is defined.
  3321 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Like deletion of Methods:
  3322 </span><span class='nx-[namespace tail [nx::self]]'># Delete on the object, where the
  3323 </span><span class='nx-[namespace tail [nx::self]]'># variable handler is defined.
3324 3324 </span>
3325 3325 <span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>delete</span> <span class='nx-keyword'>property</span> <span class='nx-placeholder'>/name/</span>
3326 3326 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>delete</span> <span class='nx-keyword'>object</span> <span class='nx-keyword'>property</span> <span class='nx-placeholder'>/name/</span>
3327 3327
3328 3328 <span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>delete</span> <span class='nx-keyword'>variable</span> <span class='nx-placeholder'>/name/</span>
3329 3329 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>delete</span> <span class='nx-keyword'>object</span> <span class='nx-keyword'>variable</span> <span class='nx-placeholder'>/name/</span></pre></div></div></div></td>
3330 3330 </tr>
3331 3331 </tbody>
3332 3332 </table>
3333 3333 </div>
3334 3334 </div>
3335 3335 <div class="sect3">
3336 3336 <h4 id="_method_parameters">2.4.3. Method Parameters</h4>
3337 3337 <div class="paragraph"><p>Method parameters are used to specify the interface of a single method
3338 3338 (what kind of values may be passed to a method, what default values
3339 3339 are provided etc.).  The method parameters specifications in XOTcl 1
3340 3340 were limited and allowed only value constraints for non positional
3341 3341 arguments.</p></div>
3342 3342 <div class="paragraph"><p>NX and XOTcl 2 provide value constraints for all kind of method parameters.
3343 3343 While XOTcl 1 required non-positional arguments to be listed in front of
 
3351 3351 <col width="50%" />
3352 3352 <thead>
3353 3353 <tr>
3354 3354 <th align="left" valign="middle">XOTcl </th>
3355 3355 <th align="left" valign="middle">Next Scripting Language</th>
3356 3356 </tr>
3357 3357 </thead>
3358 3358 <tbody>
3359 3359 <tr>
3360 3360 <td align="left" valign="middle"><div><div class="listingblock">
3361 3361 <div class="content"><style type='text/css'>
3362 3362 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
3363 3363 table.nx        {border-collapse: collapse; border-spacing: 3px;}
3364 3364 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
3365 3365 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
3366 3366 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
3367 3367 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
3368 3368 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
3369 3369 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
3370 3370 </style>
3371   <pre class='nx'><span class='nx-comment'># Define method foo with non-positional
3372   </span><span class='nx-comment'># parameters (x, y and y) and positional
3373   </span><span class='nx-comment'># parameter (a and b)
  3371 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Define method foo with non-positional
  3372 </span><span class='nx-[namespace tail [nx::self]]'># parameters (x, y and y) and positional
  3373 </span><span class='nx-[namespace tail [nx::self]]'># parameter (a and b)
3374 3374 </span>
3375 3375 <span class='nx-keyword'>Class</span> C
3376 3376 C instproc foo {
3377 3377    -x:integer
3378 3378    -y:required
3379 3379    -z
3380 3380    a
3381 3381    b
3382 3382 } {
3383      <span class='nx-comment'># ...
  3383    <span class='nx-[namespace tail [nx::self]]'># ...
3384 3384 </span>}
3385 3385 C <span class='nx-keyword'>create</span> c1
3386 3386
3387   <span class='nx-comment'># invoke method foo
  3387 <span class='nx-[namespace tail [nx::self]]'># invoke method foo
3388 3388 </span>c1 foo -x 1 -y a 2 3</pre></div></div></div></td>
3389 3389 <td align="left" valign="middle"><div><div class="listingblock">
3390 3390 <div class="content"><style type='text/css'>
3391 3391 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
3392 3392 table.nx        {border-collapse: collapse; border-spacing: 3px;}
3393 3393 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
3394 3394 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
3395 3395 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
3396 3396 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
3397 3397 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
3398 3398 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
3399 3399 </style>
3400   <pre class='nx'><span class='nx-comment'># Define method foo with
3401   </span><span class='nx-comment'># non-positional parameters
3402   </span><span class='nx-comment'># (x, y and y) and positional
3403   </span><span class='nx-comment'># parameter (a and b)
  3400 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Define method foo with
  3401 </span><span class='nx-[namespace tail [nx::self]]'># non-positional parameters
  3402 </span><span class='nx-[namespace tail [nx::self]]'># (x, y and y) and positional
  3403 </span><span class='nx-[namespace tail [nx::self]]'># parameter (a and b)
3404 3404 </span>
3405 3405 <span class='nx-keyword'>Class</span> <span class='nx-keyword'>create</span> C {
3406 3406    <span class='nx-keyword'>:public</span> <span class='nx-keyword'>method</span> foo {
3407 3407       -x:integer
3408 3408       -y:required
3409 3409       -z
3410 3410       a
3411 3411       b
3412 3412    } {
3413         <span class='nx-comment'># ...
  3413       <span class='nx-[namespace tail [nx::self]]'># ...
3414 3414 </span>   }
3415 3415    <span class='nx-keyword'>:create</span> c1
3416 3416 }
3417   <span class='nx-comment'># invoke method foo
  3417 <span class='nx-[namespace tail [nx::self]]'># invoke method foo
3418 3418 </span>c1 foo -x 1 -y a 2 3</pre></div></div></div></td>
3419 3419 </tr>
3420 3420 <tr>
3421 3421 <td align="left" valign="middle"><div><div class="listingblock">
3422 3422 <div class="content"><style type='text/css'>
3423 3423 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
3424 3424 table.nx        {border-collapse: collapse; border-spacing: 3px;}
3425 3425 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
3426 3426 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
3427 3427 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
3428 3428 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
3429 3429 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
3430 3430 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
3431 3431 </style>
3432   <pre class='nx'><span class='nx-comment'># Only leading non-positional
3433   </span><span class='nx-comment'># parameters are available; no
3434   </span><span class='nx-comment'># optional positional parameters,
3435   </span><span class='nx-comment'># no value constraints on
3436   </span><span class='nx-comment'># positional parameters,
3437   </span><span class='nx-comment'># no multiplicity, ...</span></pre></div></div></div></td>
  3432 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Only leading non-positional
  3433 </span><span class='nx-[namespace tail [nx::self]]'># parameters are available; no
  3434 </span><span class='nx-[namespace tail [nx::self]]'># optional positional parameters,
  3435 </span><span class='nx-[namespace tail [nx::self]]'># no value constraints on
  3436 </span><span class='nx-[namespace tail [nx::self]]'># positional parameters,
  3437 </span><span class='nx-[namespace tail [nx::self]]'># no multiplicity, ...</span></pre></div></div></div></td>
3438 3438 <td align="left" valign="middle"><div><div class="listingblock">
3439 3439 <div class="content"><style type='text/css'>
3440 3440 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
3441 3441 table.nx        {border-collapse: collapse; border-spacing: 3px;}
3442 3442 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
3443 3443 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
3444 3444 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
3445 3445 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
3446 3446 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
3447 3447 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
3448 3448 </style>
3449   <pre class='nx'><span class='nx-comment'># Define various forms of parameters
3450   </span><span class='nx-comment'># not available in XOTcl 1
  3449 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Define various forms of parameters
  3450 </span><span class='nx-[namespace tail [nx::self]]'># not available in XOTcl 1
3451 3451 </span>
3452 3452 <span class='nx-keyword'>Class</span> <span class='nx-keyword'>create</span> C {
3453     <span class='nx-comment'># trailing (or interleaved) non-positional
3454   </span>  <span class='nx-comment'># parameters
  3453   <span class='nx-[namespace tail [nx::self]]'># trailing (or interleaved) non-positional
  3454 </span>  <span class='nx-[namespace tail [nx::self]]'># parameters
3455 3455 </span>  <span class='nx-keyword'>:public</span> <span class='nx-keyword'>method</span> m1 {a b -x:integer -y} {
3456       <span class='nx-comment'># ...
  3456     <span class='nx-[namespace tail [nx::self]]'># ...
3457 3457 </span>  }
3458 3458
3459     <span class='nx-comment'># positional parameters with value constraints
  3459   <span class='nx-[namespace tail [nx::self]]'># positional parameters with value constraints
3460 3460 </span>  <span class='nx-keyword'>:public</span> <span class='nx-keyword'>method</span> m2 {a:integer b:boolean} {
3461       <span class='nx-comment'>#...
  3461     <span class='nx-[namespace tail [nx::self]]'>#...
3462 3462 </span>  }
3463 3463
3464     <span class='nx-comment'># optional positional parameter (trailing)
  3464   <span class='nx-[namespace tail [nx::self]]'># optional positional parameter (trailing)
3465 3465 </span>  <span class='nx-keyword'>:public</span> <span class='nx-keyword'>method</span> <span class='nx-keyword'>set</span> {varName value:optional} {
3466       <span class='nx-comment'># ....
  3466     <span class='nx-[namespace tail [nx::self]]'># ....
3467 3467 </span>  }
3468 3468
3469     <span class='nx-comment'># parameter with multiplicity
  3469   <span class='nx-[namespace tail [nx::self]]'># parameter with multiplicity
3470 3470 </span>  <span class='nx-keyword'>:public</span> <span class='nx-keyword'>method</span> m3 {-objs<span class='nx-keyword'>:object</span>,1..n c<span class='nx-keyword'>:class</span>,0..1} {
3471       <span class='nx-comment'># ...
  3471     <span class='nx-[namespace tail [nx::self]]'># ...
3472 3472 </span>  }
3473 3473
3474     <span class='nx-comment'># In general, the same list of value
3475   </span>  <span class='nx-comment'># constraints as for configure parameter is
3476   </span>  <span class='nx-comment'># available (see above).
3477   </span>  <span class='nx-comment'>#
3478   </span>  <span class='nx-comment'># User defined value constraints are
3479   </span>  <span class='nx-comment'># possible. All parameter value checkers
3480   </span>  <span class='nx-comment'># can be turned on and off.
  3474   <span class='nx-[namespace tail [nx::self]]'># In general, the same list of value
  3475 </span>  <span class='nx-[namespace tail [nx::self]]'># constraints as for configure parameter is
  3476 </span>  <span class='nx-[namespace tail [nx::self]]'># available (see above).
  3477 </span>  <span class='nx-[namespace tail [nx::self]]'>#
  3478 </span>  <span class='nx-[namespace tail [nx::self]]'># User defined value constraints are
  3479 </span>  <span class='nx-[namespace tail [nx::self]]'># possible. All parameter value checkers
  3480 </span>  <span class='nx-[namespace tail [nx::self]]'># can be turned on and off.
3481 3481 </span>}</pre></div></div></div></td>
3482 3482 </tr>
3483 3483 </tbody>
3484 3484 </table>
3485 3485 </div>
3486 3486 </div>
3487 3487 <div class="sect3">
3488 3488 <h4 id="_return_value_checking">2.4.4. Return Value Checking</h4>
3489 3489 <div class="paragraph"><p><em>Return value checking</em> is a functionality available in the Next
3490 3490 Scripting Framework, that was not yet available in XOTcl 1. A return
3491 3491 value checker assures that a method returns always a value satisfying
3492 3492 some value constraints. Return value checkers can be defined on all
3493 3493 forms of methods (scripted or C-implemented). Like for other value
3494 3494 checkers, return value checkers can be turned on and off.</p></div>
3495 3495 <div class="tableblock">
3496 3496 <table rules="all"
3497 3497 width="100%"
3498 3498 frame="void"
3499 3499 cellspacing="0" cellpadding="4">
3500 3500 <col width="50%" />
3501 3501 <col width="50%" />
3502 3502 <thead>
3503 3503 <tr>
3504 3504 <th align="left" valign="middle">XOTcl </th>
3505 3505 <th align="left" valign="middle">Next Scripting Language</th>
3506 3506 </tr>
3507 3507 </thead>
3508 3508 <tbody>
3509 3509 <tr>
3510 3510 <td align="left" valign="middle"><div><div class="listingblock">
3511 3511 <div class="content"><style type='text/css'>
3512 3512 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
3513 3513 table.nx        {border-collapse: collapse; border-spacing: 3px;}
3514 3514 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
3515 3515 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
3516 3516 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
3517 3517 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
3518 3518 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
3519 3519 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
3520 3520 </style>
3521   <pre class='nx'><span class='nx-comment'># No return value checking
3522   </span><span class='nx-comment'># available</span></pre></div></div></div></td>
  3521 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># No return value checking
  3522 </span><span class='nx-[namespace tail [nx::self]]'># available</span></pre></div></div></div></td>
3523 3523 <td align="left" valign="middle"><div><div class="listingblock">
3524 3524 <div class="content"><style type='text/css'>
3525 3525 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
3526 3526 table.nx        {border-collapse: collapse; border-spacing: 3px;}
3527 3527 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
3528 3528 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
3529 3529 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
3530 3530 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
3531 3531 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
3532 3532 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
3533 3533 </style>
3534   <pre class='nx'><span class='nx-comment'># Define method foo with non-positional
3535   </span><span class='nx-comment'># parameters (x, y and y) and positional
3536   </span><span class='nx-comment'># parameter (a and b)
  3534 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Define method foo with non-positional
  3535 </span><span class='nx-[namespace tail [nx::self]]'># parameters (x, y and y) and positional
  3536 </span><span class='nx-[namespace tail [nx::self]]'># parameter (a and b)
3537 3537 </span>
3538 3538 <span class='nx-keyword'>Class</span> <span class='nx-keyword'>create</span> C {
3539 3539
3540     <span class='nx-comment'># Define method foo which returns an
3541   </span>  <span class='nx-comment'># integer value
  3540   <span class='nx-[namespace tail [nx::self]]'># Define method foo which returns an
  3541 </span>  <span class='nx-[namespace tail [nx::self]]'># integer value
3542 3542 </span>  <span class='nx-keyword'>:method</span> foo -returns integer {-x:integer} {
3543       <span class='nx-comment'># ...
  3543     <span class='nx-[namespace tail [nx::self]]'># ...
3544 3544 </span>   }
3545 3545
3546     <span class='nx-comment'># Define an alias for the Tcl command ::incr
3547   </span>  <span class='nx-comment'># and assure, it always returns an integer
3548   </span>  <span class='nx-comment'># value
  3546   <span class='nx-[namespace tail [nx::self]]'># Define an alias for the Tcl command ::incr
  3547 </span>  <span class='nx-[namespace tail [nx::self]]'># and assure, it always returns an integer
  3548 </span>  <span class='nx-[namespace tail [nx::self]]'># value
3549 3549 </span>  <span class='nx-keyword'>:alias</span> <span class='nx-keyword'>incr</span> -returns integer ::incr
3550 3550
3551     <span class='nx-comment'># Define a forwarder that has to return an
3552   </span>  <span class='nx-comment'># integer value
  3551   <span class='nx-[namespace tail [nx::self]]'># Define a forwarder that has to return an
  3552 </span>  <span class='nx-[namespace tail [nx::self]]'># integer value
3553 3553 </span>  <span class='nx-keyword'>:forward</span> ++ -returns integer ::expr 1 +
3554 3554
3555    <span class='nx-comment'># Define a method that has to return a
3556   </span> <span class='nx-comment'># non-empty list of objects
  3555  <span class='nx-[namespace tail [nx::self]]'># Define a method that has to return a
  3556 </span> <span class='nx-[namespace tail [nx::self]]'># non-empty list of objects
3557 3557 </span> <span class='nx-keyword'>:public</span> <span class='nx-keyword'>object</span> <span class='nx-keyword'>method</span> instances {} \
3558 3558     -returns <span class='nx-keyword'>object</span>,1..n {
3559 3559    <span class='nx-keyword'>return</span> [<span class='nx-keyword'>:info</span> instances]
3560 3560   }
3561 3561 }</pre></div></div></div></td>
3562 3562 </tr>
3563 3563 </tbody>
3564 3564 </table>
3565 3565 </div>
3566 3566 </div>
3567 3567 </div>
3568 3568 <div class="sect2">
3569 3569 <h3 id="_interceptors">2.5. Interceptors</h3>
3570 3570 <div class="paragraph"><p>XOTcl and NX allow the definition of the same set of interceptors,
3571 3571 namely class- and object-level mixins and class- and object-level
3572 3572 filters. The primary difference in NX is the naming, since NX abandons
3573 3573 the prefix "inst" from the names of instance specific method, but uses
3574 3574 the the modifier <code>objec</code>" for object specific methods.</p></div>
3575 3575 <div class="paragraph"><p>Therefore, in NX, if a <code>mixin</code> is registered on a class-level, it is
3576 3576 applicable for the instances (a per-class mixin), and if and <code>object
 
3592 3592 <th align="left" valign="middle">XOTcl </th>
3593 3593 <th align="left" valign="middle">Next Scripting Language</th>
3594 3594 </tr>
3595 3595 </thead>
3596 3596 <tbody>
3597 3597 <tr>
3598 3598 <td align="left" valign="middle"><div><div class="listingblock">
3599 3599 <div class="content"><style type='text/css'>
3600 3600 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
3601 3601 table.nx        {border-collapse: collapse; border-spacing: 3px;}
3602 3602 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
3603 3603 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
3604 3604 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
3605 3605 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
3606 3606 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
3607 3607 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
3608 3608 </style>
3609 3609 <pre class='nx'><span class='nx-placeholder'>/cls/</span> instmixin ...
3610 3610 <span class='nx-placeholder'>/cls/</span> instmixinguard /<span class='nx-keyword'>mixin</span>/ <span class='nx-placeholder'>?condition?</span>
3611 3611
3612   <span class='nx-comment'># Query per-class mixin
  3612 <span class='nx-[namespace tail [nx::self]]'># Query per-class mixin
3613 3613 </span><span class='nx-placeholder'>/cls/</span> instmixin</pre></div></div></div></td>
3614 3614 <td align="left" valign="middle"><div><div class="listingblock">
3615 3615 <div class="content"><style type='text/css'>
3616 3616 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
3617 3617 table.nx        {border-collapse: collapse; border-spacing: 3px;}
3618 3618 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
3619 3619 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
3620 3620 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
3621 3621 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
3622 3622 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
3623 3623 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
3624 3624 </style>
3625   <pre class='nx'><span class='nx-comment'># Register/clear per-class mixin and guard for
3626   </span><span class='nx-comment'># a class
  3625 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Register/clear per-class mixin and guard for
  3626 </span><span class='nx-[namespace tail [nx::self]]'># a class
3627 3627 </span>
3628 3628 <span class='nx-placeholder'>/cls/</span> mixins add|<span class='nx-keyword'>set</span>|clear ...
3629 3629 <span class='nx-placeholder'>/cls/</span> mixins <span class='nx-keyword'>guard</span> /<span class='nx-keyword'>mixin</span>/ <span class='nx-placeholder'>?condition?</span>
3630 3630 <span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>configure</span> -mixin ...
3631 3631
3632   <span class='nx-comment'># Query per-class mixins
  3632 <span class='nx-[namespace tail [nx::self]]'># Query per-class mixins
3633 3633 </span><span class='nx-placeholder'>/cls/</span> mixins get
3634 3634 <span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>cget</span> -mixins
3635 3635
3636   <span class='nx-comment'># Query per-class mixins (without guards)
  3636 <span class='nx-[namespace tail [nx::self]]'># Query per-class mixins (without guards)
3637 3637 </span><span class='nx-placeholder'>/cls/</span> mixins classes</pre></div></div></div></td>
3638 3638 </tr>
3639 3639 <tr>
3640 3640 <td align="left" valign="middle"><div><div class="listingblock">
3641 3641 <div class="content"><style type='text/css'>
3642 3642 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
3643 3643 table.nx        {border-collapse: collapse; border-spacing: 3px;}
3644 3644 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
3645 3645 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
3646 3646 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
3647 3647 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
3648 3648 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
3649 3649 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
3650 3650 </style>
3651 3651 <pre class='nx'><span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>mixin</span> ...
3652 3652 <span class='nx-placeholder'>/obj/</span> mixinguard /<span class='nx-keyword'>mixin</span>/ <span class='nx-placeholder'>?condition?</span>
3653 3653
3654   <span class='nx-comment'># Query per-object mixins
  3654 <span class='nx-[namespace tail [nx::self]]'># Query per-object mixins
3655 3655 </span><span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>mixin</span></pre></div></div></div></td>
3656 3656 <td align="left" valign="middle"><div><div class="listingblock">
3657 3657 <div class="content"><style type='text/css'>
3658 3658 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
3659 3659 table.nx        {border-collapse: collapse; border-spacing: 3px;}
3660 3660 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
3661 3661 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
3662 3662 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
3663 3663 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
3664 3664 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
3665 3665 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
3666 3666 </style>
3667   <pre class='nx'><span class='nx-comment'># Register/clear per-object mixin and guard for
3668   </span><span class='nx-comment'># an object
  3667 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Register/clear per-object mixin and guard for
  3668 </span><span class='nx-[namespace tail [nx::self]]'># an object
3669 3669 </span>
3670 3670 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>object</span> mixins add|<span class='nx-keyword'>set</span>|clear ...
3671 3671 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>object</span> mixins <span class='nx-keyword'>guard</span> /<span class='nx-keyword'>mixin</span>/ <span class='nx-placeholder'>?condition?</span>
3672 3672 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>configure</span> -object-mixins ...
3673 3673
3674   <span class='nx-comment'># Query per-object mixin
  3674 <span class='nx-[namespace tail [nx::self]]'># Query per-object mixin
3675 3675 </span><span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>object</span> mixins get
3676 3676 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>cget</span> -object-mixin
3677 3677
3678   <span class='nx-comment'># Query per-object mixins (without guards)
  3678 <span class='nx-[namespace tail [nx::self]]'># Query per-object mixins (without guards)
3679 3679 </span><span class='nx-placeholder'>/cls/</span> mixins classes</pre></div></div></div></td>
3680 3680 </tr>
3681 3681 </tbody>
3682 3682 </table>
3683 3683 </div>
3684 3684 </div>
3685 3685 <div class="sect3">
3686 3686 <h4 id="_register_filters_and_filter_guards">2.5.2. Register Filters and Filter Guards</h4>
3687 3687 <div class="tableblock">
3688 3688 <table rules="all"
3689 3689 width="100%"
3690 3690 frame="void"
3691 3691 cellspacing="0" cellpadding="4">
3692 3692 <col width="50%" />
3693 3693 <col width="50%" />
3694 3694 <thead>
3695 3695 <tr>
3696 3696 <th align="left" valign="middle">XOTcl </th>
3697 3697 <th align="left" valign="middle">Next Scripting Language</th>
3698 3698 </tr>
3699 3699 </thead>
3700 3700 <tbody>
3701 3701 <tr>
3702 3702 <td align="left" valign="middle"><div><div class="listingblock">
3703 3703 <div class="content"><style type='text/css'>
3704 3704 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
3705 3705 table.nx        {border-collapse: collapse; border-spacing: 3px;}
3706 3706 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
3707 3707 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
3708 3708 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
3709 3709 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
3710 3710 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
3711 3711 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
3712 3712 </style>
3713   <pre class='nx'><span class='nx-comment'># Register per-class filter and guard for
3714   </span><span class='nx-comment'># a class
  3713 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Register per-class filter and guard for
  3714 </span><span class='nx-[namespace tail [nx::self]]'># a class
3715 3715 </span><span class='nx-placeholder'>/cls/</span> instfilter ...
3716 3716 <span class='nx-placeholder'>/cls/</span> instfilterguard /<span class='nx-keyword'>filter</span>/ <span class='nx-placeholder'>?condition?</span>
3717 3717
3718   <span class='nx-comment'># Query per-class filter
  3718 <span class='nx-[namespace tail [nx::self]]'># Query per-class filter
3719 3719 </span><span class='nx-placeholder'>/cls/</span> instfilter</pre></div></div></div></td>
3720 3720 <td align="left" valign="middle"><div><div class="listingblock">
3721 3721 <div class="content"><style type='text/css'>
3722 3722 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
3723 3723 table.nx        {border-collapse: collapse; border-spacing: 3px;}
3724 3724 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
3725 3725 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
3726 3726 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
3727 3727 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
3728 3728 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
3729 3729 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
3730 3730 </style>
3731   <pre class='nx'><span class='nx-comment'># Register/clear per-class filter and guard for
3732   </span><span class='nx-comment'># a class
  3731 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Register/clear per-class filter and guard for
  3732 </span><span class='nx-[namespace tail [nx::self]]'># a class
3733 3733 </span>
3734 3734 <span class='nx-placeholder'>/cls/</span> filters add|<span class='nx-keyword'>set</span>|clear ...
3735 3735 <span class='nx-placeholder'>/cls/</span> filters <span class='nx-keyword'>guard</span> /<span class='nx-keyword'>filter</span>/ <span class='nx-placeholder'>?condition?</span>
3736 3736 <span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>configure</span> -filters ...
3737 3737
3738   <span class='nx-comment'># Query per-class filters
  3738 <span class='nx-[namespace tail [nx::self]]'># Query per-class filters
3739 3739 </span><span class='nx-placeholder'>/cls/</span> filters get
3740 3740 <span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>cget</span> -filters
3741 3741
3742   <span class='nx-comment'># Query per-class filters (without guards)
  3742 <span class='nx-[namespace tail [nx::self]]'># Query per-class filters (without guards)
3743 3743 </span><span class='nx-placeholder'>/cls/</span> filters <span class='nx-keyword'>methods</span></pre></div></div></div></td>
3744 3744 </tr>
3745 3745 <tr>
3746 3746 <td align="left" valign="middle"><div><div class="listingblock">
3747 3747 <div class="content"><style type='text/css'>
3748 3748 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
3749 3749 table.nx        {border-collapse: collapse; border-spacing: 3px;}
3750 3750 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
3751 3751 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
3752 3752 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
3753 3753 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
3754 3754 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
3755 3755 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
3756 3756 </style>
3757 3757 <pre class='nx'><span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>filter</span> ...
3758 3758 <span class='nx-placeholder'>/obj/</span> filterguard /<span class='nx-keyword'>filter</span>/ <span class='nx-placeholder'>?condition?</span></pre></div></div></div></td>
3759 3759 <td align="left" valign="middle"><div><div class="listingblock">
3760 3760 <div class="content"><style type='text/css'>
3761 3761 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
3762 3762 table.nx        {border-collapse: collapse; border-spacing: 3px;}
3763 3763 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
3764 3764 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
3765 3765 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
3766 3766 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
3767 3767 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
3768 3768 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
3769 3769 </style>
3770   <pre class='nx'><span class='nx-comment'># Register(clear per-object filter and guard for
3771   </span><span class='nx-comment'># an object
  3770 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Register(clear per-object filter and guard for
  3771 </span><span class='nx-[namespace tail [nx::self]]'># an object
3772 3772 </span>
3773 3773 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>object</span> filters add|<span class='nx-keyword'>set</span>|clear ...
3774 3774 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>object</span> filters <span class='nx-keyword'>guard</span> /<span class='nx-keyword'>filter</span>/ <span class='nx-placeholder'>?condition?</span>
3775 3775 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>configure</span> -object-filters ...
3776 3776
3777   <span class='nx-comment'># Query per-object filters
  3777 <span class='nx-[namespace tail [nx::self]]'># Query per-object filters
3778 3778 </span><span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>object</span> filters get
3779 3779 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>cget</span> -object-filters
3780 3780
3781   <span class='nx-comment'># Query per-object filters (without guards)
  3781 <span class='nx-[namespace tail [nx::self]]'># Query per-object filters (without guards)
3782 3782 </span><span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>object</span> filters <span class='nx-keyword'>methods</span></pre></div></div></div></td>
3783 3783 </tr>
3784 3784 </tbody>
3785 3785 </table>
3786 3786 </div>
3787 3787 </div>
3788 3788 </div>
3789 3789 <div class="sect2">
3790 3790 <h3 id="_introspection">2.6. Introspection</h3>
3791 3791 <div class="paragraph"><p>In general, introspection in NX became more orthogonal and less
3792 3792 dependent on the type of the method. In XOTcl it was e.g. necessary
3793 3793 that a developer had to know, whether a method is e.g. scripted or not
3794 3794 and has to use accordingly different sub-methods of <code>info</code>.</p></div>
3795 3795 <div class="paragraph"><p>In NX, one can use e.g. always <code>info method</code> with a subcommand and the
3796 3796 framework tries to hide the differences as far as possible. So, one
3797 3797 can for example obtain with <code>info method parameter</code> the parameters of
3798 3798 scripted and C-implemented methods the same way, one one can get the
3799 3799 definition of all methods via <code>info method definition</code> and one can get
3800 3800 an manual-like interface description via <code>info method
3801 3801 syntax</code>. In addition, NX provides means to query the type of
 
3968 3968 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
3969 3969 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
3970 3970 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
3971 3971 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
3972 3972 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
3973 3973 </style>
3974 3974 <pre class='nx'><span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>methods</span> -type scripted <span class='nx-placeholder'>?pattern?</span></pre></div></div></div></td>
3975 3975 </tr>
3976 3976 <tr>
3977 3977 <td align="left" valign="middle"><div><div class="listingblock">
3978 3978 <div class="content"><style type='text/css'>
3979 3979 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
3980 3980 table.nx        {border-collapse: collapse; border-spacing: 3px;}
3981 3981 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
3982 3982 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
3983 3983 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
3984 3984 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
3985 3985 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
3986 3986 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
3987 3987 </style>
3988   <pre class='nx'><span class='nx-comment'># n.a.</span></pre></div></div></div></td>
  3988 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># n.a.</span></pre></div></div></div></td>
3989 3989 <td align="left" valign="middle"><div><div class="listingblock">
3990 3990 <div class="content"><style type='text/css'>
3991 3991 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
3992 3992 table.nx        {border-collapse: collapse; border-spacing: 3px;}
3993 3993 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
3994 3994 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
3995 3995 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
3996 3996 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
3997 3997 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
3998 3998 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
3999 3999 </style>
4000 4000 <pre class='nx'><span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>methods</span> -type <span class='nx-keyword'>alias</span> <span class='nx-placeholder'>?pattern?</span>
4001 4001 <span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>methods</span> -type forwarder <span class='nx-placeholder'>?pattern?</span>
4002 4002 <span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>methods</span> -type <span class='nx-keyword'>object</span> <span class='nx-placeholder'>?pattern?</span>
4003 4003 <span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>methods</span> -callprotection <span class='nx-keyword'>public</span>|<span class='nx-keyword'>protected</span> ...</pre></div></div></div></td>
4004 4004 </tr>
4005 4005 </tbody>
4006 4006 </table>
4007 4007 </div>
4008 4008 </div>
 
4099 4099 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
4100 4100 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
4101 4101 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
4102 4102 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
4103 4103 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
4104 4104 </style>
4105 4105 <pre class='nx'><span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>object</span> <span class='nx-keyword'>methods</span> -type scripted <span class='nx-placeholder'>?pattern?</span></pre></div></div></div></td>
4106 4106 </tr>
4107 4107 <tr>
4108 4108 <td align="left" valign="middle"><div><div class="listingblock">
4109 4109 <div class="content"><style type='text/css'>
4110 4110 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
4111 4111 table.nx        {border-collapse: collapse; border-spacing: 3px;}
4112 4112 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
4113 4113 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
4114 4114 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
4115 4115 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
4116 4116 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
4117 4117 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
4118 4118 </style>
4119   <pre class='nx'><span class='nx-comment'># n.a.</span></pre></div></div></div></td>
  4119 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># n.a.</span></pre></div></div></div></td>
4120 4120 <td align="left" valign="middle"><div><div class="listingblock">
4121 4121 <div class="content"><style type='text/css'>
4122 4122 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
4123 4123 table.nx        {border-collapse: collapse; border-spacing: 3px;}
4124 4124 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
4125 4125 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
4126 4126 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
4127 4127 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
4128 4128 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
4129 4129 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
4130 4130 </style>
4131 4131 <pre class='nx'><span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>object</span> <span class='nx-keyword'>methods</span> -type <span class='nx-keyword'>alias</span> <span class='nx-placeholder'>?pattern?</span>
4132 4132 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>object</span> <span class='nx-keyword'>methods</span> -type forwarder <span class='nx-placeholder'>?pattern?</span>
4133 4133 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>object</span> <span class='nx-keyword'>methods</span> -type <span class='nx-keyword'>object</span> <span class='nx-placeholder'>?pattern?</span>
4134 4134 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>object</span> <span class='nx-keyword'>methods</span> -callprotection <span class='nx-keyword'>public</span>|<span class='nx-keyword'>protected</span> ...</pre></div></div></div></td>
4135 4135 </tr>
4136 4136 </tbody>
4137 4137 </table>
4138 4138 </div>
4139 4139 </div>
 
4223 4223 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
4224 4224 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
4225 4225 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
4226 4226 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
4227 4227 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
4228 4228 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
4229 4229 </style>
4230 4230 <pre class='nx'><span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>methods</span> <span class='nx-placeholder'>?pattern?</span></pre></div></div></div></td>
4231 4231 <td align="left" valign="middle"><div><div class="listingblock">
4232 4232 <div class="content"><style type='text/css'>
4233 4233 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
4234 4234 table.nx        {border-collapse: collapse; border-spacing: 3px;}
4235 4235 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
4236 4236 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
4237 4237 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
4238 4238 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
4239 4239 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
4240 4240 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
4241 4241 </style>
4242 4242 <pre class='nx'><span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>lookup</span> <span class='nx-keyword'>methods</span> ... <span class='nx-placeholder'>?pattern?</span>
4243   <span class='nx-comment'># Returns list of method names</span></pre></div></div></div></td>
  4243 <span class='nx-[namespace tail [nx::self]]'># Returns list of method names</span></pre></div></div></div></td>
4244 4244 </tr>
4245 4245 <tr>
4246 4246 <td align="left" valign="middle"><div><div class="listingblock">
4247 4247 <div class="content"><style type='text/css'>
4248 4248 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
4249 4249 table.nx        {border-collapse: collapse; border-spacing: 3px;}
4250 4250 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
4251 4251 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
4252 4252 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
4253 4253 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
4254 4254 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
4255 4255 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
4256 4256 </style>
4257   <pre class='nx'><span class='nx-comment'># n.a.</span></pre></div></div></div></td>
  4257 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># n.a.</span></pre></div></div></div></td>
4258 4258 <td align="left" valign="middle"><div><div class="listingblock">
4259 4259 <div class="content"><style type='text/css'>
4260 4260 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
4261 4261 table.nx        {border-collapse: collapse; border-spacing: 3px;}
4262 4262 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
4263 4263 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
4264 4264 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
4265 4265 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
4266 4266 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
4267 4267 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
4268 4268 </style>
4269   <pre class='nx'><span class='nx-comment'># List only application specific methods
  4269 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># List only application specific methods
4270 4270 </span><span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>lookup</span> <span class='nx-keyword'>methods</span> -source application ... <span class='nx-placeholder'>?pattern?</span>
4271   <span class='nx-comment'># Returns list of method names</span></pre></div></div></div></td>
  4271 <span class='nx-[namespace tail [nx::self]]'># Returns list of method names</span></pre></div></div></div></td>
4272 4272 </tr>
4273 4273 <tr>
4274 4274 <td align="left" valign="middle"><div><div class="listingblock">
4275 4275 <div class="content"><style type='text/css'>
4276 4276 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
4277 4277 table.nx        {border-collapse: collapse; border-spacing: 3px;}
4278 4278 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
4279 4279 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
4280 4280 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
4281 4281 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
4282 4282 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
4283 4283 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
4284 4284 </style>
4285   <pre class='nx'><span class='nx-comment'># Options for 'info methods'
4286   </span><span class='nx-comment'>#
4287   </span><span class='nx-comment'># -incontext
4288   </span><span class='nx-comment'># -nomixins</span></pre></div></div></div></td>
  4285 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Options for 'info methods'
  4286 </span><span class='nx-[namespace tail [nx::self]]'>#
  4287 </span><span class='nx-[namespace tail [nx::self]]'># -incontext
  4288 </span><span class='nx-[namespace tail [nx::self]]'># -nomixins</span></pre></div></div></div></td>
4289 4289 <td align="left" valign="middle"><div><div class="listingblock">
4290 4290 <div class="content"><style type='text/css'>
4291 4291 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
4292 4292 table.nx        {border-collapse: collapse; border-spacing: 3px;}
4293 4293 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
4294 4294 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
4295 4295 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
4296 4296 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
4297 4297 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
4298 4298 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
4299 4299 </style>
4300   <pre class='nx'><span class='nx-comment'># Options for 'info lookup methods'
4301   </span><span class='nx-comment'>#
4302   </span><span class='nx-comment'># -source ...
4303   </span><span class='nx-comment'># -callprotection ...
4304   </span><span class='nx-comment'># -incontext
4305   </span><span class='nx-comment'># -type ...
4306   </span><span class='nx-comment'># -nomixins</span></pre></div></div></div></td>
  4300 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Options for 'info lookup methods'
  4301 </span><span class='nx-[namespace tail [nx::self]]'>#
  4302 </span><span class='nx-[namespace tail [nx::self]]'># -source ...
  4303 </span><span class='nx-[namespace tail [nx::self]]'># -callprotection ...
  4304 </span><span class='nx-[namespace tail [nx::self]]'># -incontext
  4305 </span><span class='nx-[namespace tail [nx::self]]'># -type ...
  4306 </span><span class='nx-[namespace tail [nx::self]]'># -nomixins</span></pre></div></div></div></td>
4307 4307 </tr>
4308 4308 <tr>
4309 4309 <td align="left" valign="middle"><div><div class="listingblock">
4310 4310 <div class="content"><style type='text/css'>
4311 4311 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
4312 4312 table.nx        {border-collapse: collapse; border-spacing: 3px;}
4313 4313 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
4314 4314 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
4315 4315 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
4316 4316 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
4317 4317 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
4318 4318 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
4319 4319 </style>
4320   <pre class='nx'><span class='nx-comment'># n.a.</span></pre></div></div></div></td>
  4320 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># n.a.</span></pre></div></div></div></td>
4321 4321 <td align="left" valign="middle"><div><div class="listingblock">
4322 4322 <div class="content"><style type='text/css'>
4323 4323 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
4324 4324 table.nx        {border-collapse: collapse; border-spacing: 3px;}
4325 4325 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
4326 4326 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
4327 4327 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
4328 4328 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
4329 4329 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
4330 4330 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
4331 4331 </style>
4332   <pre class='nx'><span class='nx-comment'># List slot objects defined for obj
4333   </span><span class='nx-comment'># -source might be all|application|baseclasses
4334   </span><span class='nx-comment'># -type is the class of the slot object
  4332 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># List slot objects defined for obj
  4333 </span><span class='nx-[namespace tail [nx::self]]'># -source might be all|application|baseclasses
  4334 </span><span class='nx-[namespace tail [nx::self]]'># -type is the class of the slot object
4335 4335 </span>
4336 4336 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>lookup</span> slots <span class='nx-placeholder'>?-type ...?</span> <span class='nx-placeholder'>?-source ...?</span> <span class='nx-placeholder'>?pattern?</span>
4337 4337
4338   <span class='nx-comment'># Returns list of slot objects</span></pre></div></div></div></td>
  4338 <span class='nx-[namespace tail [nx::self]]'># Returns list of slot objects</span></pre></div></div></div></td>
4339 4339 </tr>
4340 4340 <tr>
4341 4341 <td align="left" valign="middle"><div><div class="listingblock">
4342 4342 <div class="content"><style type='text/css'>
4343 4343 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
4344 4344 table.nx        {border-collapse: collapse; border-spacing: 3px;}
4345 4345 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
4346 4346 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
4347 4347 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
4348 4348 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
4349 4349 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
4350 4350 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
4351 4351 </style>
4352   <pre class='nx'><span class='nx-comment'># List registered filters
  4352 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># List registered filters
4353 4353 </span><span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> filters -order <span class='nx-placeholder'>?-guards?</span> <span class='nx-placeholder'>?pattern?</span>
4354 4354
4355   <span class='nx-comment'># List registered mixins
  4355 <span class='nx-[namespace tail [nx::self]]'># List registered mixins
4356 4356 </span><span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> mixins -heritage <span class='nx-placeholder'>?-guards?</span> <span class='nx-placeholder'>?pattern?</span></pre></div></div></div></td>
4357 4357 <td align="left" valign="middle"><div><div class="listingblock">
4358 4358 <div class="content"><style type='text/css'>
4359 4359 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
4360 4360 table.nx        {border-collapse: collapse; border-spacing: 3px;}
4361 4361 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
4362 4362 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
4363 4363 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
4364 4364 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
4365 4365 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
4366 4366 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
4367 4367 </style>
4368   <pre class='nx'><span class='nx-comment'># List registered filters
  4368 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># List registered filters
4369 4369 </span><span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>lookup</span> filters <span class='nx-placeholder'>?-guards?</span> <span class='nx-placeholder'>?pattern?</span>
4370 4370
4371   <span class='nx-comment'># List registered mixins
  4371 <span class='nx-[namespace tail [nx::self]]'># List registered mixins
4372 4372 </span><span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>lookup</span> mixins <span class='nx-placeholder'>?-guards?</span> <span class='nx-placeholder'>?pattern?</span></pre></div></div></div></td>
4373 4373 </tr>
4374 4374 </tbody>
4375 4375 </table>
4376 4376 </div>
4377 4377 </div>
4378 4378 <div class="sect3">
4379 4379 <h4 id="_list_object_class_where_a_specified_method_is_defined">2.6.6. List object/class where a specified method is defined</h4>
4380 4380 <div class="paragraph"><p><code>info lookup</code> can be used as well to determine, where exactly an
4381 4381  artefact is located. One can obtain this way a method handle, where
4382 4382 a method or filter is defined.</p></div>
4383 4383 <div class="paragraph"><p>The concept of a <em>method-handle</em> is new in NX. The method-handle
4384 4384 can be used to obtain more information about the method, such as
4385 4385 e.g. the definition of the method.</p></div>
4386 4386 <div class="tableblock">
4387 4387 <table rules="all"
4388 4388 width="100%"
4389 4389 frame="void"
4390 4390 cellspacing="0" cellpadding="4">
4391 4391 <col width="50%" />
 
4405 4405 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
4406 4406 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
4407 4407 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
4408 4408 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
4409 4409 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
4410 4410 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
4411 4411 </style>
4412 4412 <pre class='nx'><span class='nx-placeholder'>/obj/</span> procsearch <span class='nx-placeholder'>/methodName/</span></pre></div></div></div></td>
4413 4413 <td align="left" valign="middle"><div><div class="listingblock">
4414 4414 <div class="content"><style type='text/css'>
4415 4415 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
4416 4416 table.nx        {border-collapse: collapse; border-spacing: 3px;}
4417 4417 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
4418 4418 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
4419 4419 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
4420 4420 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
4421 4421 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
4422 4422 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
4423 4423 </style>
4424 4424 <pre class='nx'><span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>lookup</span> <span class='nx-keyword'>method</span> <span class='nx-placeholder'>/methodName/</span>
4425   <span class='nx-comment'># Returns method-handle</span></pre></div></div></div></td>
  4425 <span class='nx-[namespace tail [nx::self]]'># Returns method-handle</span></pre></div></div></div></td>
4426 4426 </tr>
4427 4427 <tr>
4428 4428 <td align="left" valign="middle"><div><div class="listingblock">
4429 4429 <div class="content"><style type='text/css'>
4430 4430 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
4431 4431 table.nx        {border-collapse: collapse; border-spacing: 3px;}
4432 4432 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
4433 4433 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
4434 4434 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
4435 4435 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
4436 4436 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
4437 4437 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
4438 4438 </style>
4439 4439 <pre class='nx'><span class='nx-placeholder'>/obj/</span> filtersearch <span class='nx-placeholder'>/methodName/</span></pre></div></div></div></td>
4440 4440 <td align="left" valign="middle"><div><div class="listingblock">
4441 4441 <div class="content"><style type='text/css'>
4442 4442 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
4443 4443 table.nx        {border-collapse: collapse; border-spacing: 3px;}
4444 4444 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
4445 4445 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
4446 4446 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
4447 4447 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
4448 4448 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
4449 4449 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
4450 4450 </style>
4451 4451 <pre class='nx'><span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>lookup</span> <span class='nx-keyword'>filter</span> <span class='nx-placeholder'>/methodName/</span>
4452   <span class='nx-comment'># Returns method-handle</span></pre></div></div></div></td>
  4452 <span class='nx-[namespace tail [nx::self]]'># Returns method-handle</span></pre></div></div></div></td>
4453 4453 </tr>
4454 4454 </tbody>
4455 4455 </table>
4456 4456 </div>
4457 4457 </div>
4458 4458 <div class="sect3">
4459 4459 <h4 id="_list_definition_of_scripted_methods">2.6.7. List definition of scripted methods</h4>
4460 4460 <div class="paragraph"><p>XOTcl contains a long list of <code>info</code> subcommands for different kinds of
4461 4461 methods and for obtaining more detailed information about these
4462 4462 methods.</p></div>
4463 4463 <div class="paragraph"><p>In NX, this list of <code>info</code> subcommands is much shorter and more
4464 4464 orthogonal. For example <code>info method definition</code> can be used to obtain
4465 4465 with a single command the full definition of a <em>scripted method</em>, and
4466 4466 furthermore, it works as well the same way to obtain e.g. the
4467 4467 definition of a <em>forwarder</em> or an <em>alias</em>.</p></div>
4468 4468 <div class="paragraph"><p>While XOTcl uses different names for info options for objects and
4469 4469 classes (using the prefix "inst" for instance specific method), NX
4470 4470 uses for object specific method the modifier <code>object</code>. For definition
4471 4471 of class object specific methods, use the modifier <code>object</code> as usual.</p></div>
4472 4472 <div class="tableblock">
 
4478 4478 <col width="50%" />
4479 4479 <thead>
4480 4480 <tr>
4481 4481 <th align="left" valign="middle">XOTcl </th>
4482 4482 <th align="left" valign="middle">Next Scripting Language</th>
4483 4483 </tr>
4484 4484 </thead>
4485 4485 <tbody>
4486 4486 <tr>
4487 4487 <td align="left" valign="middle"><div><div class="listingblock">
4488 4488 <div class="content"><style type='text/css'>
4489 4489 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
4490 4490 table.nx        {border-collapse: collapse; border-spacing: 3px;}
4491 4491 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
4492 4492 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
4493 4493 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
4494 4494 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
4495 4495 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
4496 4496 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
4497 4497 </style>
4498   <pre class='nx'><span class='nx-comment'># n.a.</span></pre></div></div></div></td>
  4498 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># n.a.</span></pre></div></div></div></td>
4499 4499 <td align="left" valign="middle"><div><div class="listingblock">
4500 4500 <div class="content"><style type='text/css'>
4501 4501 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
4502 4502 table.nx        {border-collapse: collapse; border-spacing: 3px;}
4503 4503 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
4504 4504 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
4505 4505 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
4506 4506 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
4507 4507 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
4508 4508 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
4509 4509 </style>
4510 4510 <pre class='nx'><span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>method</span> definition <span class='nx-placeholder'>/methodName/</span>
4511 4511 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>object</span> <span class='nx-keyword'>method</span> definition <span class='nx-placeholder'>/methodName/</span></pre></div></div></div></td>
4512 4512 </tr>
4513 4513 <tr>
4514 4514 <td align="left" valign="middle"><div><div class="listingblock">
4515 4515 <div class="content"><style type='text/css'>
4516 4516 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
4517 4517 table.nx        {border-collapse: collapse; border-spacing: 3px;}
4518 4518 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
 
4602 4602 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
4603 4603 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
4604 4604 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
4605 4605 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
4606 4606 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
4607 4607 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
4608 4608 </style>
4609 4609 <pre class='nx'><span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>info</span> instdefault <span class='nx-placeholder'>/methodName/</span>
4610 4610 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> default <span class='nx-placeholder'>/methodName/</span></pre></div></div></div></td>
4611 4611 <td align="left" valign="middle"><div><div class="listingblock">
4612 4612 <div class="content"><style type='text/css'>
4613 4613 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
4614 4614 table.nx        {border-collapse: collapse; border-spacing: 3px;}
4615 4615 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
4616 4616 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
4617 4617 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
4618 4618 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
4619 4619 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
4620 4620 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
4621 4621 </style>
4622   <pre class='nx'><span class='nx-comment'># not needed, part of
4623   </span><span class='nx-comment'># "info ?object? method parameter"</span></pre></div></div></div></td>
  4622 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># not needed, part of
  4623 </span><span class='nx-[namespace tail [nx::self]]'># "info ?object? method parameter"</span></pre></div></div></div></td>
4624 4624 </tr>
4625 4625 <tr>
4626 4626 <td align="left" valign="middle"><div><div class="listingblock">
4627 4627 <div class="content"><style type='text/css'>
4628 4628 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
4629 4629 table.nx        {border-collapse: collapse; border-spacing: 3px;}
4630 4630 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
4631 4631 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
4632 4632 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
4633 4633 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
4634 4634 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
4635 4635 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
4636 4636 </style>
4637 4637 <pre class='nx'><span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>info</span> instpre <span class='nx-placeholder'>/methodName/</span>
4638 4638 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> pre <span class='nx-placeholder'>/methodName/</span></pre></div></div></div></td>
4639 4639 <td align="left" valign="middle"><div><div class="listingblock">
4640 4640 <div class="content"><style type='text/css'>
4641 4641 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
4642 4642 table.nx        {border-collapse: collapse; border-spacing: 3px;}
4643 4643 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
 
4694 4694 <col width="50%" />
4695 4695 <thead>
4696 4696 <tr>
4697 4697 <th align="left" valign="middle">XOTcl </th>
4698 4698 <th align="left" valign="middle">Next Scripting Language</th>
4699 4699 </tr>
4700 4700 </thead>
4701 4701 <tbody>
4702 4702 <tr>
4703 4703 <td align="left" valign="middle"><div><div class="listingblock">
4704 4704 <div class="content"><style type='text/css'>
4705 4705 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
4706 4706 table.nx        {border-collapse: collapse; border-spacing: 3px;}
4707 4707 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
4708 4708 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
4709 4709 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
4710 4710 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
4711 4711 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
4712 4712 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
4713 4713 </style>
4714   <pre class='nx'><span class='nx-comment'># n.a.</span></pre></div></div></div></td>
  4714 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># n.a.</span></pre></div></div></div></td>
4715 4715 <td align="left" valign="middle"><div><div class="listingblock">
4716 4716 <div class="content"><style type='text/css'>
4717 4717 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
4718 4718 table.nx        {border-collapse: collapse; border-spacing: 3px;}
4719 4719 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
4720 4720 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
4721 4721 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
4722 4722 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
4723 4723 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
4724 4724 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
4725 4725 </style>
4726 4726 <pre class='nx'><span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>method</span> syntax <span class='nx-placeholder'>/methodName/</span>
4727 4727 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>object</span> <span class='nx-keyword'>method</span> syntax <span class='nx-placeholder'>/methodName/</span></pre></div></div></div></td>
4728 4728 </tr>
4729 4729 </tbody>
4730 4730 </table>
4731 4731 </div>
4732 4732 </div>
4733 4733 <div class="sect3">
4734 4734 <h4 id="info_configure_parameter">2.6.8. List Configure Parameters</h4>
 
4746 4746 <col width="50%" />
4747 4747 <thead>
4748 4748 <tr>
4749 4749 <th align="left" valign="middle">XOTcl </th>
4750 4750 <th align="left" valign="middle">Next Scripting Language</th>
4751 4751 </tr>
4752 4752 </thead>
4753 4753 <tbody>
4754 4754 <tr>
4755 4755 <td align="left" valign="middle"><div><div class="listingblock">
4756 4756 <div class="content"><style type='text/css'>
4757 4757 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
4758 4758 table.nx        {border-collapse: collapse; border-spacing: 3px;}
4759 4759 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
4760 4760 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
4761 4761 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
4762 4762 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
4763 4763 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
4764 4764 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
4765 4765 </style>
4766   <pre class='nx'><span class='nx-comment'># n.a.</span></pre></div></div></div></td>
  4766 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># n.a.</span></pre></div></div></div></td>
4767 4767 <td align="left" valign="middle"><div><div class="listingblock">
4768 4768 <div class="content"><style type='text/css'>
4769 4769 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
4770 4770 table.nx        {border-collapse: collapse; border-spacing: 3px;}
4771 4771 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
4772 4772 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
4773 4773 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
4774 4774 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
4775 4775 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
4776 4776 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
4777 4777 </style>
4778   <pre class='nx'><span class='nx-comment'># Return the parameters applicable to
4779   </span><span class='nx-comment'># the create method of a certain class.
4780   </span><span class='nx-comment'># class can be configured. A pattern can
4781   </span><span class='nx-comment'># be used to filter the results.
  4778 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Return the parameters applicable to
  4779 </span><span class='nx-[namespace tail [nx::self]]'># the create method of a certain class.
  4780 </span><span class='nx-[namespace tail [nx::self]]'># class can be configured. A pattern can
  4781 </span><span class='nx-[namespace tail [nx::self]]'># be used to filter the results.
4782 4782 </span>
4783 4783 <span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>lookup</span> parameters <span class='nx-keyword'>create</span> ?<span class='nx-placeholder'>/pattern/</span>?
4784 4784
4785   <span class='nx-comment'># Return in the result in documentation syntax
  4785 <span class='nx-[namespace tail [nx::self]]'># Return in the result in documentation syntax
4786 4786 </span>
4787 4787 <span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>lookup</span> syntax <span class='nx-keyword'>create</span> ?<span class='nx-placeholder'>/pattern/</span>?
4788 4788
4789   <span class='nx-comment'># "info lookup parameters configure" returns
4790   </span><span class='nx-comment'># parameters available for configuring the
4791   </span><span class='nx-comment'># current object  (might contain object
4792   </span><span class='nx-comment'># specific information)
  4789 <span class='nx-[namespace tail [nx::self]]'># "info lookup parameters configure" returns
  4790 </span><span class='nx-[namespace tail [nx::self]]'># parameters available for configuring the
  4791 </span><span class='nx-[namespace tail [nx::self]]'># current object  (might contain object
  4792 </span><span class='nx-[namespace tail [nx::self]]'># specific information)
4793 4793 </span>
4794 4794 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>lookup</span> parameters <span class='nx-keyword'>configure</span> <span class='nx-placeholder'>?pattern?</span>
4795 4795
4796   <span class='nx-comment'># "info lookup configure syntax" returns syntax of
4797   </span><span class='nx-comment'># a call to configure in the Tcl parameter syntax
  4796 <span class='nx-[namespace tail [nx::self]]'># "info lookup configure syntax" returns syntax of
  4797 </span><span class='nx-[namespace tail [nx::self]]'># a call to configure in the Tcl parameter syntax
4798 4798 </span>
4799 4799 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>lookup</span> syntax <span class='nx-keyword'>configure</span>
4800 4800
4801   <span class='nx-comment'># Obtain information from a parameter
4802   </span><span class='nx-comment'># (as e.g. returned from "info lookup
4803   </span><span class='nx-comment'># parameters configure").
  4801 <span class='nx-[namespace tail [nx::self]]'># Obtain information from a parameter
  4802 </span><span class='nx-[namespace tail [nx::self]]'># (as e.g. returned from "info lookup
  4803 </span><span class='nx-[namespace tail [nx::self]]'># parameters configure").
4804 4804 </span>
4805 4805 nsf::parameter::info name <span class='nx-placeholder'>/parameter/</span>
4806 4806 nsf::parameter::info syntax <span class='nx-placeholder'>/parameter/</span>
4807 4807 nsf::parameter::info type <span class='nx-placeholder'>/parameter/</span></pre></div></div></div></td>
4808 4808 </tr>
4809 4809 </tbody>
4810 4810 </table>
4811 4811 </div>
4812 4812 </div>
4813 4813 <div class="sect3">
4814 4814 <h4 id="_list_variable_declarations_property_and_variable">2.6.9. List Variable Declarations (property and variable)</h4>
4815 4815 <div class="tableblock">
4816 4816 <table rules="all"
4817 4817 width="100%"
4818 4818 frame="void"
4819 4819 cellspacing="0" cellpadding="4">
4820 4820 <col width="50%" />
4821 4821 <col width="50%" />
4822 4822 <thead>
4823 4823 <tr>
4824 4824 <th align="left" valign="middle">XOTcl </th>
4825 4825 <th align="left" valign="middle">Next Scripting Language</th>
4826 4826 </tr>
4827 4827 </thead>
4828 4828 <tbody>
4829 4829 <tr>
4830 4830 <td align="left" valign="middle"><div><div class="listingblock">
4831 4831 <div class="content"><style type='text/css'>
4832 4832 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
4833 4833 table.nx        {border-collapse: collapse; border-spacing: 3px;}
4834 4834 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
4835 4835 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
4836 4836 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
4837 4837 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
4838 4838 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
4839 4839 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
4840 4840 </style>
4841   <pre class='nx'><span class='nx-comment'># obtain parameter definitions defined
4842   </span><span class='nx-comment'># for a class
  4841 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># obtain parameter definitions defined
  4842 </span><span class='nx-[namespace tail [nx::self]]'># for a class
4843 4843 </span><span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>info</span> parameter</pre></div></div></div></td>
4844 4844 <td align="left" valign="middle"><div><div class="listingblock">
4845 4845 <div class="content"><style type='text/css'>
4846 4846 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
4847 4847 table.nx        {border-collapse: collapse; border-spacing: 3px;}
4848 4848 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
4849 4849 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
4850 4850 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
4851 4851 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
4852 4852 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
4853 4853 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
4854 4854 </style>
4855   <pre class='nx'><span class='nx-comment'># "info variables" returns handles of
4856   </span><span class='nx-comment'># properties and variables defined by this
4857   </span><span class='nx-comment'># class or object
  4855 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># "info variables" returns handles of
  4856 </span><span class='nx-[namespace tail [nx::self]]'># properties and variables defined by this
  4857 </span><span class='nx-[namespace tail [nx::self]]'># class or object
4858 4858 </span>
4859 4859 <span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>info</span> variables <span class='nx-placeholder'>?pattern?</span>
4860 4860 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>object</span> variables <span class='nx-placeholder'>?pattern?</span>
4861 4861
4862   <span class='nx-comment'># "info lookup variables" returns handles
4863   </span><span class='nx-comment'># of variables and properties applicable
4864   </span><span class='nx-comment'># for the current object (might contain
4865   </span><span class='nx-comment'># object specific information)
  4862 <span class='nx-[namespace tail [nx::self]]'># "info lookup variables" returns handles
  4863 </span><span class='nx-[namespace tail [nx::self]]'># of variables and properties applicable
  4864 </span><span class='nx-[namespace tail [nx::self]]'># for the current object (might contain
  4865 </span><span class='nx-[namespace tail [nx::self]]'># object specific information)
4866 4866 </span>
4867 4867 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>lookup</span> variables <span class='nx-placeholder'>/pattern/</span>
4868 4868
4869   <span class='nx-comment'># "info variable" lists details about a
4870   </span><span class='nx-comment'># single property or variable.
  4869 <span class='nx-[namespace tail [nx::self]]'># "info variable" lists details about a
  4870 </span><span class='nx-[namespace tail [nx::self]]'># single property or variable.
4871 4871 </span>
4872 4872 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>variable</span> definition <span class='nx-placeholder'>/handle/</span>
4873 4873 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>variable</span> name <span class='nx-placeholder'>/handle/</span>
4874 4874 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>variable</span> parameter <span class='nx-placeholder'>/handle/</span></pre></div></div></div></td>
4875 4875 </tr>
4876 4876 </tbody>
4877 4877 </table>
4878 4878 </div>
4879 4879 </div>
4880 4880 <div class="sect3">
4881 4881 <h4 id="_list_slots">2.6.10. List Slots</h4>
4882 4882 <div class="tableblock">
4883 4883 <table rules="all"
4884 4884 width="100%"
4885 4885 frame="void"
4886 4886 cellspacing="0" cellpadding="4">
4887 4887 <col width="50%" />
4888 4888 <col width="50%" />
4889 4889 <thead>
4890 4890 <tr>
4891 4891 <th align="left" valign="middle">XOTcl </th>
4892 4892 <th align="left" valign="middle">Next Scripting Language</th>
4893 4893 </tr>
4894 4894 </thead>
4895 4895 <tbody>
4896 4896 <tr>
4897 4897 <td align="left" valign="middle"><div><div class="listingblock">
4898 4898 <div class="content"><style type='text/css'>
4899 4899 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
4900 4900 table.nx        {border-collapse: collapse; border-spacing: 3px;}
4901 4901 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
4902 4902 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
4903 4903 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
4904 4904 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
4905 4905 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
4906 4906 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
4907 4907 </style>
4908   <pre class='nx'><span class='nx-comment'># n.a.</span></pre></div></div></div></td>
  4908 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># n.a.</span></pre></div></div></div></td>
4909 4909 <td align="left" valign="middle"><div><div class="listingblock">
4910 4910 <div class="content"><style type='text/css'>
4911 4911 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
4912 4912 table.nx        {border-collapse: collapse; border-spacing: 3px;}
4913 4913 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
4914 4914 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
4915 4915 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
4916 4916 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
4917 4917 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
4918 4918 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
4919 4919 </style>
4920   <pre class='nx'><span class='nx-comment'># Return list of slots objects defined on the
4921   </span><span class='nx-comment'># object or class
4922   </span><span class='nx-comment'>#
4923   </span><span class='nx-comment'># -source might be all|application|baseclasses
4924   </span><span class='nx-comment'># -type is the class of the slot object
4925   </span><span class='nx-comment'># -closure includes slots of superclasses
  4920 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Return list of slots objects defined on the
  4921 </span><span class='nx-[namespace tail [nx::self]]'># object or class
  4922 </span><span class='nx-[namespace tail [nx::self]]'>#
  4923 </span><span class='nx-[namespace tail [nx::self]]'># -source might be all|application|baseclasses
  4924 </span><span class='nx-[namespace tail [nx::self]]'># -type is the class of the slot object
  4925 </span><span class='nx-[namespace tail [nx::self]]'># -closure includes slots of superclasses
4926 4926 </span>
4927 4927 <span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>info</span> slots \
4928 4928    <span class='nx-placeholder'>?-type value?</span> <span class='nx-placeholder'>?-closure?</span> <span class='nx-placeholder'>?-source value?</span> <span class='nx-placeholder'>?pattern?</span>
4929 4929 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>object</span> slots <span class='nx-placeholder'>?-type ...?</span> <span class='nx-placeholder'>?pattern?</span>
4930 4930
4931   <span class='nx-comment'># List reachable slot objects defined for obj
4932   </span><span class='nx-comment'># -source might be all|application|baseclasses
4933   </span><span class='nx-comment'># -type is the class of the slot object
4934   </span><span class='nx-comment'># Returns list of slot objects.
  4931 <span class='nx-[namespace tail [nx::self]]'># List reachable slot objects defined for obj
  4932 </span><span class='nx-[namespace tail [nx::self]]'># -source might be all|application|baseclasses
  4933 </span><span class='nx-[namespace tail [nx::self]]'># -type is the class of the slot object
  4934 </span><span class='nx-[namespace tail [nx::self]]'># Returns list of slot objects.
4935 4935 </span>
4936 4936 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>lookup</span> slots \
4937 4937    <span class='nx-placeholder'>?-type ...?</span> <span class='nx-placeholder'>?-source ... ?</span>pattern?
4938 4938
4939   <span class='nx-comment'># Obtain definition, name or parameter from
4940   </span><span class='nx-comment'># slot object
  4939 <span class='nx-[namespace tail [nx::self]]'># Obtain definition, name or parameter from
  4940 </span><span class='nx-[namespace tail [nx::self]]'># slot object
4941 4941 </span>
4942 4942 <span class='nx-placeholder'>/slotobj/</span> definition
4943 4943 <span class='nx-placeholder'>/slotobj/</span> name
4944 4944 <span class='nx-placeholder'>/slotobj/</span> parameter</pre></div></div></div></td>
4945 4945 </tr>
4946 4946 </tbody>
4947 4947 </table>
4948 4948 </div>
4949 4949 </div>
4950 4950 <div class="sect3">
4951 4951 <h4 id="_list_filter_or_mixins">2.6.11. List Filter or Mixins</h4>
4952 4952 <div class="paragraph"><p>In NX all introspection options for filters are provided via
4953 4953 <code>info filters</code> and all introspection options for mixins are
4954 4954 provided via <code>info mixins</code>.</p></div>
4955 4955 <div class="tableblock">
4956 4956 <table rules="all"
4957 4957 width="100%"
4958 4958 frame="void"
4959 4959 cellspacing="0" cellpadding="4">
4960 4960 <col width="50%" />
 
5098 5098 <col width="50%" />
5099 5099 <thead>
5100 5100 <tr>
5101 5101 <th align="left" valign="middle">XOTcl </th>
5102 5102 <th align="left" valign="middle">Next Scripting Language</th>
5103 5103 </tr>
5104 5104 </thead>
5105 5105 <tbody>
5106 5106 <tr>
5107 5107 <td align="left" valign="middle"><div><div class="listingblock">
5108 5108 <div class="content"><style type='text/css'>
5109 5109 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
5110 5110 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5111 5111 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5112 5112 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5113 5113 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5114 5114 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5115 5115 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5116 5116 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5117 5117 </style>
5118   <pre class='nx'><span class='nx-comment'># n.a.</span></pre></div></div></div></td>
  5118 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># n.a.</span></pre></div></div></div></td>
5119 5119 <td align="left" valign="middle"><div><div class="listingblock">
5120 5120 <div class="content"><style type='text/css'>
5121 5121 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
5122 5122 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5123 5123 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5124 5124 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5125 5125 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5126 5126 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5127 5127 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5128 5128 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5129 5129 </style>
5130 5130 <pre class='nx'><span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>method</span> definition <span class='nx-placeholder'>/methodName/</span>
5131 5131 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>object</span> <span class='nx-keyword'>method</span> definition <span class='nx-placeholder'>/methodName/</span></pre></div></div></div></td>
5132 5132 </tr>
5133 5133 </tbody>
5134 5134 </table>
5135 5135 </div>
5136 5136 </div>
5137 5137 <div class="sect3">
5138 5138 <h4 id="_list_method_handles">2.6.13. List Method-Handles</h4>
 
5149 5149 <col width="50%" />
5150 5150 <thead>
5151 5151 <tr>
5152 5152 <th align="left" valign="middle">XOTcl </th>
5153 5153 <th align="left" valign="middle">Next Scripting Language</th>
5154 5154 </tr>
5155 5155 </thead>
5156 5156 <tbody>
5157 5157 <tr>
5158 5158 <td align="left" valign="middle"><div><div class="listingblock">
5159 5159 <div class="content"><style type='text/css'>
5160 5160 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
5161 5161 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5162 5162 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5163 5163 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5164 5164 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5165 5165 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5166 5166 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5167 5167 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5168 5168 </style>
5169   <pre class='nx'><span class='nx-comment'># n.a.</span></pre></div></div></div></td>
  5169 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># n.a.</span></pre></div></div></div></td>
5170 5170 <td align="left" valign="middle"><div><div class="listingblock">
5171 5171 <div class="content"><style type='text/css'>
5172 5172 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
5173 5173 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5174 5174 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5175 5175 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5176 5176 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5177 5177 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5178 5178 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5179 5179 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5180 5180 </style>
5181   <pre class='nx'><span class='nx-comment'>#
5182   </span><span class='nx-comment'># List the method handle of the specified method,
5183   </span><span class='nx-comment'># can be used e.g. for aliases. "handle" is the short
5184   </span><span class='nx-comment'># form of "definitionhandle".
5185   </span><span class='nx-comment'>#
  5181 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'>#
  5182 </span><span class='nx-[namespace tail [nx::self]]'># List the method handle of the specified method,
  5183 </span><span class='nx-[namespace tail [nx::self]]'># can be used e.g. for aliases. "handle" is the short
  5184 </span><span class='nx-[namespace tail [nx::self]]'># form of "definitionhandle".
  5185 </span><span class='nx-[namespace tail [nx::self]]'>#
5186 5186 </span><span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>method</span> handle <span class='nx-placeholder'>/methodName/</span>
5187 5187 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>object</span> <span class='nx-keyword'>method</span> handle <span class='nx-placeholder'>/methodName/</span>
5188   <span class='nx-comment'>#
5189   </span><span class='nx-comment'># For ensemble methods (method name contains
5190   </span><span class='nx-comment'># spaces) one can query as well the registration
5191   </span><span class='nx-comment'># handle, which is the handle to the root of the
5192   </span><span class='nx-comment'># ensemble; the definiton handle points to the
5193   </span><span class='nx-comment'># leaf of the ensemble.
5194   </span><span class='nx-comment'>#
  5188 <span class='nx-[namespace tail [nx::self]]'>#
  5189 </span><span class='nx-[namespace tail [nx::self]]'># For ensemble methods (method name contains
  5190 </span><span class='nx-[namespace tail [nx::self]]'># spaces) one can query as well the registration
  5191 </span><span class='nx-[namespace tail [nx::self]]'># handle, which is the handle to the root of the
  5192 </span><span class='nx-[namespace tail [nx::self]]'># ensemble; the definiton handle points to the
  5193 </span><span class='nx-[namespace tail [nx::self]]'># leaf of the ensemble.
  5194 </span><span class='nx-[namespace tail [nx::self]]'>#
5195 5195 </span><span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>method</span> registrationhandle <span class='nx-placeholder'>/methodName/</span>
5196 5196 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>object</span> <span class='nx-keyword'>method</span> registrationhandle <span class='nx-placeholder'>/methodName/</span>
5197   <span class='nx-comment'>#
5198   </span><span class='nx-comment'># For aliases, one can query the original
5199   </span><span class='nx-comment'># definition via "info method origin"
5200   </span><span class='nx-comment'>#
  5197 <span class='nx-[namespace tail [nx::self]]'>#
  5198 </span><span class='nx-[namespace tail [nx::self]]'># For aliases, one can query the original
  5199 </span><span class='nx-[namespace tail [nx::self]]'># definition via "info method origin"
  5200 </span><span class='nx-[namespace tail [nx::self]]'>#
5201 5201 </span><span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>method</span> origin <span class='nx-placeholder'>/methodName/</span>
5202 5202 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>object</span> <span class='nx-keyword'>method</span> origin <span class='nx-placeholder'>/methodName/</span></pre></div></div></div></td>
5203 5203 </tr>
5204 5204 </tbody>
5205 5205 </table>
5206 5206 </div>
5207 5207 </div>
5208 5208 <div class="sect3">
5209 5209 <h4 id="_list_type_of_a_method">2.6.14. List type of a method</h4>
5210 5210 <div class="paragraph"><p>The method <code>info ?object? method type</code> is new in NX to obtain the type of the
5211 5211 specified method.</p></div>
5212 5212 <div class="tableblock">
5213 5213 <table rules="all"
5214 5214 width="100%"
5215 5215 frame="void"
5216 5216 cellspacing="0" cellpadding="4">
5217 5217 <col width="50%" />
5218 5218 <col width="50%" />
5219 5219 <thead>
5220 5220 <tr>
5221 5221 <th align="left" valign="middle">XOTcl </th>
5222 5222 <th align="left" valign="middle">Next Scripting Language</th>
5223 5223 </tr>
5224 5224 </thead>
5225 5225 <tbody>
5226 5226 <tr>
5227 5227 <td align="left" valign="middle"><div><div class="listingblock">
5228 5228 <div class="content"><style type='text/css'>
5229 5229 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
5230 5230 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5231 5231 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5232 5232 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5233 5233 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5234 5234 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5235 5235 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5236 5236 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5237 5237 </style>
5238   <pre class='nx'><span class='nx-comment'># n.a.</span></pre></div></div></div></td>
  5238 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># n.a.</span></pre></div></div></div></td>
5239 5239 <td align="left" valign="middle"><div><div class="listingblock">
5240 5240 <div class="content"><style type='text/css'>
5241 5241 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
5242 5242 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5243 5243 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5244 5244 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5245 5245 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5246 5246 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5247 5247 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5248 5248 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5249 5249 </style>
5250 5250 <pre class='nx'><span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>method</span> type <span class='nx-placeholder'>/methodName/</span>
5251 5251 <span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> <span class='nx-keyword'>object</span> <span class='nx-keyword'>method</span> type <span class='nx-placeholder'>/methodName/</span></pre></div></div></div></td>
5252 5252 </tr>
5253 5253 </tbody>
5254 5254 </table>
5255 5255 </div>
5256 5256 </div>
5257 5257 <div class="sect3">
5258 5258 <h4 id="_list_the_scope_of_mixin_classes">2.6.15. List the scope of mixin classes</h4>
 
5279 5279 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5280 5280 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5281 5281 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5282 5282 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5283 5283 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5284 5284 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5285 5285 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5286 5286 </style>
5287 5287 <pre class='nx'><span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>info</span> mixinof <span class='nx-placeholder'>?-closure?</span> <span class='nx-placeholder'>?pattern?</span></pre></div></div></div></td>
5288 5288 <td align="left" valign="middle"><div><div class="listingblock">
5289 5289 <div class="content"><style type='text/css'>
5290 5290 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
5291 5291 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5292 5292 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5293 5293 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5294 5294 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5295 5295 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5296 5296 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5297 5297 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5298 5298 </style>
5299   <pre class='nx'><span class='nx-comment'># List objects, where /cls/ is a
5300   </span><span class='nx-comment'># per-object mixin
  5299 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># List objects, where /cls/ is a
  5300 </span><span class='nx-[namespace tail [nx::self]]'># per-object mixin
5301 5301 </span>
5302 5302 <span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>info</span> mixinof -scope <span class='nx-keyword'>object</span> <span class='nx-placeholder'>?-closure?</span> \
5303 5303    <span class='nx-placeholder'>?pattern?</span></pre></div></div></div></td>
5304 5304 </tr>
5305 5305 <tr>
5306 5306 <td align="left" valign="middle"><div><div class="listingblock">
5307 5307 <div class="content"><style type='text/css'>
5308 5308 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
5309 5309 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5310 5310 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5311 5311 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5312 5312 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5313 5313 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5314 5314 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5315 5315 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5316 5316 </style>
5317 5317 <pre class='nx'><span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>info</span> instmixinof <span class='nx-placeholder'>?-closure?</span> <span class='nx-placeholder'>?pattern?</span></pre></div></div></div></td>
5318 5318 <td align="left" valign="middle"><div><div class="listingblock">
5319 5319 <div class="content"><style type='text/css'>
5320 5320 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
5321 5321 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5322 5322 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5323 5323 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5324 5324 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5325 5325 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5326 5326 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5327 5327 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5328 5328 </style>
5329   <pre class='nx'><span class='nx-comment'># List classes, where /cls/ is a per-class mixin
  5329 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># List classes, where /cls/ is a per-class mixin
5330 5330 </span>
5331 5331 <span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>info</span> mixinof -scope <span class='nx-keyword'>class</span> <span class='nx-placeholder'>?-closure?</span> \
5332 5332    <span class='nx-placeholder'>?pattern?</span></pre></div></div></div></td>
5333 5333 </tr>
5334 5334 <tr>
5335 5335 <td align="left" valign="middle"><div><div class="listingblock">
5336 5336 <div class="content"><style type='text/css'>
5337 5337 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
5338 5338 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5339 5339 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5340 5340 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5341 5341 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5342 5342 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5343 5343 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5344 5344 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5345 5345 </style>
5346   <pre class='nx'><span class='nx-comment'># n.a.</span></pre></div></div></div></td>
  5346 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># n.a.</span></pre></div></div></div></td>
5347 5347 <td align="left" valign="middle"><div><div class="listingblock">
5348 5348 <div class="content"><style type='text/css'>
5349 5349 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
5350 5350 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5351 5351 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5352 5352 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5353 5353 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5354 5354 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5355 5355 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5356 5356 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5357 5357 </style>
5358   <pre class='nx'><span class='nx-comment'># List objects and classes, where /cls/ is
5359   </span><span class='nx-comment'># either a per-object or a per-class mixin
  5358 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># List objects and classes, where /cls/ is
  5359 </span><span class='nx-[namespace tail [nx::self]]'># either a per-object or a per-class mixin
5360 5360 </span>
5361 5361 <span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>info</span> mixinof -scope all <span class='nx-placeholder'>?-closure?</span> \
5362 5362    <span class='nx-placeholder'>?pattern?</span></pre></div></div>
5363 5363 <div class="listingblock">
5364 5364 <div class="content"><style type='text/css'>
5365 5365 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
5366 5366 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5367 5367 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5368 5368 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5369 5369 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5370 5370 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5371 5371 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5372 5372 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5373 5373 </style>
5374 5374 <pre class='nx'><span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>info</span> mixinof <span class='nx-placeholder'>?-closure?</span> <span class='nx-placeholder'>?pattern?</span></pre></div></div></div></td>
5375 5375 </tr>
5376 5376 </tbody>
5377 5377 </table>
5378 5378 </div>
5379 5379 </div>
 
5402 5402 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5403 5403 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5404 5404 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5405 5405 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5406 5406 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5407 5407 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5408 5408 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5409 5409 </style>
5410 5410 <pre class='nx'><span class='nx-placeholder'>/obj/</span> istype <span class='nx-placeholder'>/sometype/</span></pre></div></div></div></td>
5411 5411 <td align="left" valign="middle"><div><div class="listingblock">
5412 5412 <div class="content"><style type='text/css'>
5413 5413 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
5414 5414 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5415 5415 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5416 5416 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5417 5417 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5418 5418 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5419 5419 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5420 5420 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5421 5421 </style>
5422   <pre class='nx'><span class='nx-comment'># Check if object is a subtype of some class
  5422 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Check if object is a subtype of some class
5423 5423 </span><span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> has type <span class='nx-placeholder'>/sometype/</span></pre></div></div></div></td>
5424 5424 </tr>
5425 5425 <tr>
5426 5426 <td align="left" valign="middle"><div><div class="listingblock">
5427 5427 <div class="content"><style type='text/css'>
5428 5428 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
5429 5429 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5430 5430 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5431 5431 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5432 5432 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5433 5433 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5434 5434 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5435 5435 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5436 5436 </style>
5437 5437 <pre class='nx'><span class='nx-placeholder'>/obj/</span> ismixin <span class='nx-placeholder'>/cls/</span></pre></div></div></div></td>
5438 5438 <td align="left" valign="middle"><div><div class="listingblock">
5439 5439 <div class="content"><style type='text/css'>
5440 5440 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
5441 5441 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5442 5442 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5443 5443 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5444 5444 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5445 5445 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5446 5446 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5447 5447 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5448 5448 </style>
5449   <pre class='nx'><span class='nx-comment'># Check if object has the specified mixin registered
  5449 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Check if object has the specified mixin registered
5450 5450 </span><span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> has <span class='nx-keyword'>mixin</span> <span class='nx-placeholder'>/cls/</span></pre></div></div></div></td>
5451 5451 </tr>
5452 5452 <tr>
5453 5453 <td align="left" valign="middle"><div><div class="listingblock">
5454 5454 <div class="content"><style type='text/css'>
5455 5455 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
5456 5456 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5457 5457 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5458 5458 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5459 5459 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5460 5460 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5461 5461 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5462 5462 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5463 5463 </style>
5464 5464 <pre class='nx'><span class='nx-placeholder'>/obj/</span> isclass ?<span class='nx-placeholder'>/cls/</span>?</pre></div></div></div></td>
5465 5465 <td align="left" valign="middle"><div><div class="listingblock">
5466 5466 <div class="content"><style type='text/css'>
5467 5467 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
5468 5468 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5469 5469 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5470 5470 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5471 5471 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5472 5472 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5473 5473 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5474 5474 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5475 5475 </style>
5476   <pre class='nx'><span class='nx-keyword'>cd</span> <span class='nx-comment'># Check if object is an NX class
  5476 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Check if object is an NX class
5477 5477 </span><span class='nx-placeholder'>/obj/</span> has type ::nx::Class
5478 5478
5479   <span class='nx-comment'># Check if object is a class in one of the
5480   </span><span class='nx-comment'># NSF object systems
  5479 <span class='nx-[namespace tail [nx::self]]'># Check if object is a class in one of the
  5480 </span><span class='nx-[namespace tail [nx::self]]'># NSF object systems
5481 5481 </span>::nsf::is <span class='nx-keyword'>class</span> <span class='nx-placeholder'>/obj/</span></pre></div></div></div></td>
5482 5482 </tr>
5483 5483 <tr>
5484 5484 <td align="left" valign="middle"><div><div class="listingblock">
5485 5485 <div class="content"><style type='text/css'>
5486 5486 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
5487 5487 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5488 5488 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5489 5489 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5490 5490 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5491 5491 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5492 5492 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5493 5493 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5494 5494 </style>
5495 5495 <pre class='nx'><span class='nx-placeholder'>/obj/</span> ismetaclass <span class='nx-placeholder'>/cls/</span></pre></div></div></div></td>
5496 5496 <td align="left" valign="middle"><div><div class="listingblock">
5497 5497 <div class="content"><style type='text/css'>
5498 5498 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
5499 5499 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5500 5500 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5501 5501 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5502 5502 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5503 5503 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5504 5504 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5505 5505 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5506 5506 </style>
5507   <pre class='nx'><span class='nx-comment'># Check if class is an NX metaclass
  5507 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Check if class is an NX metaclass
5508 5508 </span><span class='nx-keyword'>expr</span> {[<span class='nx-placeholder'>/cls/</span> <span class='nx-keyword'>info</span> heritage ::nx::Class] ne <span class='nx-string'>""</span>}
5509 5509
5510   <span class='nx-comment'># Check if object is a metaclass in one of the
5511   </span><span class='nx-comment'># NSF object systems
  5510 <span class='nx-[namespace tail [nx::self]]'># Check if object is a metaclass in one of the
  5511 </span><span class='nx-[namespace tail [nx::self]]'># NSF object systems
5512 5512 </span>::nsf::is <span class='nx-keyword'>metaclass</span> <span class='nx-placeholder'>/obj/</span></pre></div></div></div></td>
5513 5513 </tr>
5514 5514 <tr>
5515 5515 <td align="left" valign="middle"><div><div class="listingblock">
5516 5516 <div class="content"><style type='text/css'>
5517 5517 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
5518 5518 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5519 5519 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5520 5520 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5521 5521 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5522 5522 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5523 5523 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5524 5524 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5525 5525 </style>
5526   <pre class='nx'><span class='nx-comment'># n.a.</span></pre></div></div></div></td>
  5526 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># n.a.</span></pre></div></div></div></td>
5527 5527 <td align="left" valign="middle"><div><div class="listingblock">
5528 5528 <div class="content"><style type='text/css'>
5529 5529 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
5530 5530 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5531 5531 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5532 5532 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5533 5533 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5534 5534 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5535 5535 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5536 5536 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5537 5537 </style>
5538   <pre class='nx'><span class='nx-comment'># Check if object is a baseclass of an object system
  5538 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Check if object is a baseclass of an object system
5539 5539 </span>::nsf::is baseclass <span class='nx-placeholder'>/obj/</span></pre></div></div></div></td>
5540 5540 </tr>
5541 5541 <tr>
5542 5542 <td align="left" valign="middle"><div><div class="listingblock">
5543 5543 <div class="content"><style type='text/css'>
5544 5544 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
5545 5545 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5546 5546 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5547 5547 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5548 5548 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5549 5549 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5550 5550 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5551 5551 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5552 5552 </style>
5553   <pre class='nx'><span class='nx-comment'># n.a.</span></pre></div></div></div></td>
  5553 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># n.a.</span></pre></div></div></div></td>
5554 5554 <td align="left" valign="middle"><div><div class="listingblock">
5555 5555 <div class="content"><style type='text/css'>
5556 5556 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
5557 5557 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5558 5558 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5559 5559 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5560 5560 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5561 5561 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5562 5562 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5563 5563 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5564 5564 </style>
5565   <pre class='nx'><span class='nx-comment'># Return name of object (without namespace prefix)
  5565 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Return name of object (without namespace prefix)
5566 5566 </span><span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>info</span> name</pre></div></div></div></td>
5567 5567 </tr>
5568 5568 <tr>
5569 5569 <td align="left" valign="middle"><div><div class="listingblock">
5570 5570 <div class="content"><style type='text/css'>
5571 5571 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
5572 5572 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5573 5573 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5574 5574 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5575 5575 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5576 5576 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5577 5577 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5578 5578 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5579 5579 </style>
5580 5580 <pre class='nx'><span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>object</span>::exists <span class='nx-placeholder'>/obj/</span></pre></div></div></div></td>
5581 5581 <td align="left" valign="middle"><div><div class="listingblock">
5582 5582 <div class="content"><style type='text/css'>
5583 5583 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
5584 5584 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5585 5585 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5586 5586 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5587 5587 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5588 5588 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5589 5589 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5590 5590 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5591 5591 </style>
5592   <pre class='nx'><span class='nx-comment'># Check for existence of object (nsf primitive)
  5592 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Check for existence of object (nsf primitive)
5593 5593 </span>::nsf::object::exists <span class='nx-placeholder'>/obj/</span></pre></div></div></div></td>
5594 5594 </tr>
5595 5595 </tbody>
5596 5596 </table>
5597 5597 </div>
5598 5598 </div>
5599 5599 <div class="sect3">
5600 5600 <h4 id="_call_stack_introspection">2.6.17. Call-stack Introspection</h4>
5601 5601 <div class="paragraph"><p>Call-stack introspection is very similar in NX and XOTcl. NX uses for
5602 5602 subcommand the term <code>current</code> instead of <code>self</code>, since <code>self</code> has a
5603 5603 strong connotation to the current object. The term <code>proc</code> is renamed
5604 5604 by <code>method</code>.</p></div>
5605 5605 <div class="tableblock">
5606 5606 <table rules="all"
5607 5607 width="100%"
5608 5608 frame="void"
5609 5609 cellspacing="0" cellpadding="4">
5610 5610 <col width="50%" />
5611 5611 <col width="50%" />
5612 5612 <thead>
 
5895 5895 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5896 5896 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5897 5897 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5898 5898 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5899 5899 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5900 5900 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5901 5901 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5902 5902 </style>
5903 5903 <pre class='nx'><span class='nx-keyword'>self</span> <span class='nx-keyword'>next</span></pre></div></div></div></td>
5904 5904 <td align="left" valign="middle"><div><div class="listingblock">
5905 5905 <div class="content"><style type='text/css'>
5906 5906 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
5907 5907 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5908 5908 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5909 5909 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5910 5910 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5911 5911 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5912 5912 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5913 5913 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5914 5914 </style>
5915   <pre class='nx'><span class='nx-comment'># Returns method-handle of the
5916   </span><span class='nx-comment'># method to be called via "next"
  5915 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Returns method-handle of the
  5916 </span><span class='nx-[namespace tail [nx::self]]'># method to be called via "next"
5917 5917 </span><span class='nx-keyword'>current</span> <span class='nx-keyword'>next</span></pre></div></div></div></td>
5918 5918 </tr>
5919 5919 <tr>
5920 5920 <td align="left" valign="middle"><div><div class="listingblock">
5921 5921 <div class="content"><style type='text/css'>
5922 5922 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
5923 5923 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5924 5924 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5925 5925 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5926 5926 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5927 5927 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5928 5928 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5929 5929 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5930 5930 </style>
5931 5931 <pre class='nx'><span class='nx-keyword'>self</span> filterreg</pre></div></div></div></td>
5932 5932 <td align="left" valign="middle"><div><div class="listingblock">
5933 5933 <div class="content"><style type='text/css'>
5934 5934 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
5935 5935 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5936 5936 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5937 5937 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5938 5938 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5939 5939 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5940 5940 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5941 5941 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5942 5942 </style>
5943   <pre class='nx'><span class='nx-comment'># Returns method-handle of the
5944   </span><span class='nx-comment'># filter method
  5943 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># Returns method-handle of the
  5944 </span><span class='nx-[namespace tail [nx::self]]'># filter method
5945 5945 </span><span class='nx-keyword'>current</span> filterreg</pre></div></div></div></td>
5946 5946 </tr>
5947 5947 <tr>
5948 5948 <td align="left" valign="middle"><div><div class="listingblock">
5949 5949 <div class="content"><style type='text/css'>
5950 5950 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
5951 5951 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5952 5952 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
5953 5953 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
5954 5954 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
5955 5955 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
5956 5956 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
5957 5957 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
5958 5958 </style>
5959 5959 <pre class='nx'><span class='nx-keyword'>self</span> callinglevel</pre></div></div></div></td>
5960 5960 <td align="left" valign="middle"><div><div class="listingblock">
5961 5961 <div class="content"><style type='text/css'>
5962 5962 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
5963 5963 table.nx        {border-collapse: collapse; border-spacing: 3px;}
5964 5964 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
 
6038 6038 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
6039 6039 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
6040 6040 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
6041 6041 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
6042 6042 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
6043 6043 </style>
6044 6044 <pre class='nx'><span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>require</span> <span class='nx-keyword'>namespace</span></pre></div></div></div></td>
6045 6045 </tr>
6046 6046 <tr>
6047 6047 <td align="left" valign="middle"><div><div class="listingblock">
6048 6048 <div class="content"><style type='text/css'>
6049 6049 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
6050 6050 table.nx        {border-collapse: collapse; border-spacing: 3px;}
6051 6051 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
6052 6052 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
6053 6053 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
6054 6054 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
6055 6055 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
6056 6056 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
6057 6057 </style>
6058   <pre class='nx'><span class='nx-comment'># n.a.</span></pre></div></div></div></td>
  6058 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># n.a.</span></pre></div></div></div></td>
6059 6059 <td align="left" valign="middle"><div><div class="listingblock">
6060 6060 <div class="content"><style type='text/css'>
6061 6061 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
6062 6062 table.nx        {border-collapse: collapse; border-spacing: 3px;}
6063 6063 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
6064 6064 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
6065 6065 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
6066 6066 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
6067 6067 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
6068 6068 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
6069 6069 </style>
6070 6070 <pre class='nx'><span class='nx-placeholder'>/obj/</span> <span class='nx-keyword'>require</span> <span class='nx-keyword'>method</span></pre></div></div></div></td>
6071 6071 </tr>
6072 6072 </tbody>
6073 6073 </table>
6074 6074 </div>
6075 6075 </div>
6076 6076 <div class="sect2">
6077 6077 <h3 id="_dispatch_aliases_etc">2.8. Dispatch, Aliases, etc.</h3>
6078 6078 <div class="paragraph"><p>todo: to be done or omitted</p></div>
 
6333 6333 replaced.</p></div>
6334 6334 </div>
6335 6335 <div class="sect2">
6336 6336 <h3 id="_parameters_2">3.2. Parameters</h3>
6337 6337 <div class="paragraph"><p>The following changes for parameters could be regarded as bug-fixes.</p></div>
6338 6338 <div class="sect3">
6339 6339 <h4 id="_parameter_usage_without_a_value">3.2.1. Parameter usage without a value</h4>
6340 6340 <div class="paragraph"><p>In XOTcl 1, it was possible to call a parameter method during object
6341 6341 creation via the dash-interface without a value (in the example below <code>-x</code>).</p></div>
6342 6342 <div class="listingblock">
6343 6343 <div class="content"><style type='text/css'>
6344 6344 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
6345 6345 table.nx        {border-collapse: collapse; border-spacing: 3px;}
6346 6346 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
6347 6347 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
6348 6348 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
6349 6349 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
6350 6350 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
6351 6351 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
6352 6352 </style>
6353   <pre class='nx'><span class='nx-comment'># XOTcl example
  6353 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># XOTcl example
6354 6354 </span>
6355 6355 <span class='nx-keyword'>Class</span> Foo -parameter {x y}
6356 6356 Foo f1 -x -y 1</pre></div></div>
6357 6357 <div class="paragraph"><p>Such cases are most likely mistakes. All parameter configurations in XOTcl 2 require an argument.</p></div>
6358 6358 </div>
6359 6359 <div class="sect3">
6360 6360 <h4 id="_ignored_parameter_definitions">3.2.2. Ignored Parameter definitions</h4>
6361 6361 <div class="paragraph"><p>In XOTcl 1, a more specific parameter definition without a default was ignored
6362 6362 when a more general parameter definition with a default was
6363 6363 present. In the example below, the object <code>b1</code> contained in XOTcl 1
6364 6364 incorrectly the parameter <code>x</code> (set via default from <code>Foo</code>), while in
6365 6365 XOTcl 2, the variable won&#8217;t be set.</p></div>
6366 6366 <div class="listingblock">
6367 6367 <div class="content"><style type='text/css'>
6368 6368 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
6369 6369 table.nx        {border-collapse: collapse; border-spacing: 3px;}
6370 6370 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
6371 6371 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
6372 6372 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
6373 6373 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
6374 6374 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
6375 6375 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
6376 6376 </style>
6377   <pre class='nx'><span class='nx-comment'># XOTcl example
  6377 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># XOTcl example
6378 6378 </span>
6379 6379 <span class='nx-keyword'>Class</span> Foo -parameter {{x 1}}
6380 6380 <span class='nx-keyword'>Class</span> Bar -superclass Foo -parameter x
6381 6381 Bar b1</pre></div></div>
6382 6382 </div>
6383 6383 <div class="sect3">
6384 6384 <h4 id="_changing_classes_and_superclasses">3.2.3. Changing classes and superclasses</h4>
6385 6385 <div class="paragraph"><p>NX does not define the methods <code>class</code> and <code>superclass</code> (like XOTcl), but allows to
6386 6386 alter all object/class relations (including
6387 6387 class/superclass/object-mixin/&#8230;)
6388 6388 <code>nsf::relation::set</code>. The class and superclass can be certainly queried
6389 6389 in all variants with <code>info class</code> or <code>info superclasses</code>.</p></div>
6390 6390 <div class="listingblock">
6391 6391 <div class="content"><style type='text/css'>
6392 6392 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
6393 6393 table.nx        {border-collapse: collapse; border-spacing: 3px;}
6394 6394 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
6395 6395 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
6396 6396 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
6397 6397 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
6398 6398 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
6399 6399 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
6400 6400 </style>
6401   <pre class='nx'><span class='nx-comment'># NX example
  6401 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># NX example
6402 6402 </span>
6403 6403 <span class='nx-keyword'>nx::Class</span> <span class='nx-keyword'>create</span> Foo
6404 6404 Foo <span class='nx-keyword'>create</span> f1
6405 6405
6406   <span class='nx-comment'># now alter the class of object f1
  6406 <span class='nx-[namespace tail [nx::self]]'># now alter the class of object f1
6407 6407 </span>nsf::relation::set f1 <span class='nx-keyword'>class</span> ::nx::Object</pre></div></div>
6408 6408 </div>
6409 6409 <div class="sect3">
6410 6410 <h4 id="_overwriting_procs_methods_with_objects_and_vice_versa">3.2.4. Overwriting procs/methods with objects and vice versa</h4>
6411 6411 <div class="paragraph"><p>NSF is now more conservative on object/method creation. In contrary to
6412 6412 XOTcl 1 NSF does not allow to redefined a pre-existing command
6413 6413 (e.g. "set") with an object and vice versa. Like in XOTcl 1,
6414 6414 preexisting objects and classes con be redefined (necessary for
6415 6415 reloading objects/classes in an running interpreter).</p></div>
6416 6416 </div>
6417 6417 <div class="sect3">
6418 6418 <h4 id="_info_heritage">3.2.5. Info heritage</h4>
6419 6419 <div class="paragraph"><p><code>info heritage</code> returns in XOTcl 1 the transitive superclass
6420 6420 hierarchy, which is equivalent with <code>info superclasses -closure</code> and
6421 6421 therefore not necessary. In XOTcl 2 (and NX), <code>info heritage</code> includes
6422 6422 as well the transitive per-class mixins.</p></div>
6423 6423 </div>
6424 6424 </div>
6425 6425 <div class="sect2">
6426 6426 <h3 id="_slots">3.3. Slots</h3>
 
6439 6439 <h3 id="_stronger_checking">3.5. Stronger Checking</h3>
6440 6440 <div class="paragraph"><p>The Next Scripting Framework performs stronger checking than XOTcl 1
6441 6441 For example, the requiredness of slots in XOTcl 1 was just a
6442 6442 comment, while XOTcl 2 enforces it.</p></div>
6443 6443 </div>
6444 6444 <div class="sect2">
6445 6445 <h3 id="_exit_handlers">3.6. Exit Handlers</h3>
6446 6446 <div class="paragraph"><p>The exit hander interface changed from a method of <code>::xotcl::Object</code>
6447 6447 into the Tcl command <code>::nsf::exithandler</code>:</p></div>
6448 6448 <div class="listingblock">
6449 6449 <div class="content"><style type='text/css'>
6450 6450 .nx             {color: #000000; font-weight: normal; font-style: normal; padding-left: 10px}
6451 6451 table.nx        {border-collapse: collapse; border-spacing: 3px;}
6452 6452 .nx-linenr      {border-right: 1px solid #DDDDDD;padding-right: 5px; color: #2B547D;font-style: italic;}
6453 6453 .nx-string      {color: #779977; font-weight: normal; font-style: italic;}
6454 6454 .nx-comment     {color: #717ab3; font-weight: normal; font-style: italic;}
6455 6455 .nx-keyword     {color: #7f0055; font-weight: normal; font-style: normal;}
6456 6456 .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
6457 6457 .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
6458 6458 </style>
6459   <pre class='nx'><span class='nx-comment'># NX example
  6459 <pre class='nx'><span class='nx-[namespace tail [nx::self]]'># NX example
6460 6460 </span>::nsf::exithandler <span class='nx-keyword'>set</span>|get|<span class='nx-keyword'>unset</span> <span class='nx-placeholder'>?arg?</span></pre></div></div>
6461 6461 </div>
6462 6462 </div>
6463 6463 </div>
6464 6464 </div>
6465 6465 <div id="footnotes"><hr /></div>
6466 6466 <div id="footer">
6467 6467 <div id="footer-text">
6468   Version 2.0.0<br />
6469   Last updated 2014-12-06 16:32:23 CET
  6468 Version 2.1.0<br />
  6469 Last updated 2016-12-27 18:26:56 CET
6470 6470 </div>
6471 6471 </div>
6472 6472 </body>
6473 6473 </html>