Index: doc/next-tutorial.html =================================================================== diff -u -r57570354bfebc1bc24f1ba3d7976c44b2c2bd3e9 -rb3018d3be0f1524a3f1709edc0e2ddb5d8bc4c0b --- doc/next-tutorial.html (.../next-tutorial.html) (revision 57570354bfebc1bc24f1ba3d7976c44b2c2bd3e9) +++ doc/next-tutorial.html (.../next-tutorial.html) (revision b3018d3be0f1524a3f1709edc0e2ddb5d8bc4c0b) @@ -533,8 +533,8 @@ -

The Next Scripting Language (NX) is a successor of XOTcl 1 and is -based on 10 years of experience with XOTcl in projects containing -several hundert thousand lines of code. While XOTcl was the first -language designed to provide language support for design patterns, -the focus of the Next Scripting Framework and NX are on combining this -with Language Oriented Programming. In many respects, NX was -designed to ease the learning of the language by novices (by using a -more mainstream terminology, higher orthogonality of the methods, less -predefined methods), to improve maintainability (remove sources of -common errors) and to encourage developer to write better structured -programs (to provide interfaces) especially for large projects, where -many developers are involved.

+

The Next Scripting Language (NX) is a highly flexible, Tcl +[Ousterhout 1990] based object oriented scripting language. It is a +successor of XOTcl 1 [Neumann and Zdun 2000a] and is based on 10 +years of experience with XOTcl in projects containing several hundert +thousand lines of code. While XOTcl was the first language designed to +provide language support for design patterns, the focus of the Next +Scripting Framework and NX are on combining this with Language +Oriented Programming. In many respects, NX was designed to ease the +learning of the language by novices (by using a more mainstream +terminology, higher orthogonality of the methods, less predefined +methods), to improve maintainability (remove sources of common errors) +and to encourage developer to write better structured programs (to +provide interfaces) especially for large projects, where many +developers are involved.

The Next Scripting Language is based on the Next Scripting Framework which was developed based on the notion of language oriented programming. The Next Scripting Frameworks provides C-level support @@ -577,7 +579,7 @@

1. NX and its Roots

-

Object oriented extensions of Tcl [Ousterhout 1990] have quite a +

Object oriented extensions of Tcl have quite a long history. Two of the most prominent early Tcl based OO languages were incr Tcl (abbreviated as itcl) and Object Tcl (OTcl [Wetherall and Lindblad 1995]). While itcl provides a traditional @@ -632,7 +634,7 @@ and encapsulates the behavior of a stack and provides methods to a user of the data structure that abstract from the actual implementation.

-

2.1. Define a Class Stack

+

2.1. Define a Class "Stack"

In our first example, we define a class named Stack with the methods push and pop. When an instance of the stack is created (e.g. a concrete stack s1) the stack will be initialized via the constructor @@ -764,7 +766,7 @@ 16 17 18 -

!#/bin/env tclsh
+
#!/bin/env tclsh
 package require nx
 
 nx::Class create Stack {
@@ -817,7 +819,7 @@
 objects (and classes as well).

-

2.2. Define an Object named stack

+

2.2. Define an Object Named "stack"

The definition of the stack in Listing 2 is following the traditional object oriented approach, found in practically every object oriented programming language: Define a class @@ -1246,8 +1248,8 @@ in more detail). Since classes are objects, we can define as well object-specific methods for the class objects. However, since :method applied on classes defines methods for instances, we have to -use the method-modifier class-object to denote methods to be -applied on the class itself. Note that class-object methods are not +use the method-modifier class to denote methods to be +applied on the class itself. Note that class methods are not inherited to instances. These methods defined on the class object are actually exactly same as the object-specific methods in the examples above.

@@ -1291,7 +1293,7 @@ 26
nx::Class create Stack2 {
 
-    :class-object method available_stacks {} {
+    :public class method available_stacks {} {
       return [llength [:info instances]]
    }
 
@@ -1317,7 +1319,7 @@
 puts [Stack available_stacks]

The class Stack2 in Listing 14 consists of the the earlier definition of the class Stack extended by the -class-object-specific method available_stacks, that returns the +class-specific method available_stacks, that returns the current number of instances of the stack. The final command puts (line 26) prints 2 to the console.

@@ -2403,8 +2405,8 @@