Index: doc/Object.man =================================================================== diff -u -reed87eee0cf0a17607a7d5a056c45e6bb53ecb83 -r83b89feaa688228e7f9b25f44c2d02591601665a --- doc/Object.man (.../Object.man) (revision eed87eee0cf0a17607a7d5a056c45e6bb53ecb83) +++ doc/Object.man (.../Object.man) (revision 83b89feaa688228e7f9b25f44c2d02591601665a) @@ -19,8 +19,11 @@ [vset MODIFIER "object"] [copyright {2014 Stefan Sobernig , Gustaf Neumann ; available under the Creative Commons Attribution 3.0 Austria license (CC BY 3.0 AT).}] + +[moddesc "NX API"] [titledesc {API reference of the base class in the NX object system}] + [description] [para] @@ -806,22 +809,32 @@ [example { -Object create ::obj { - puts [current]; # 1) print name of currently active object ('::obj') - set :x 1; :object variable y 2; # 2) object variables - :public object method print {} { - set z 3; # 2.a) method-local variable - puts ${:x}-${:y}-$z; # 2.b) variable substitution using '$' and ':' - puts [set :x]-[set :y]-[set z]; # 2.c) reading variables using 'set' - set :x 1; incr :y; # 2.d) writing variables using 'set', 'incr', ... + Object create ::obj { + # 1) print name of currently active object ('::obj') + puts [current]; + # 2) object variables + set :x 1; :object variable y 2; + :public object method print {} { + # 2.a) method-local variable + set z 3; + # 2.b) variable substitution using '$' and ':' + puts ${:x}-${:y}-$z; + # 2.c) reading variables using 'set' + puts [set :x]-[set :y]-[set z]; + # 2.d) writing variables using 'set', 'incr', ... + set :x 1; incr :y; + } + :public object method show {} { + # 3.a) self-referential method call using ':' + :print; + # 3.b) self-referential method call using 'nx::current' + [current] print; + # 3.c) self-referential method call using 'nx::current object' + [current object] print; + } + :show } - :public object method show {} { - :print; # 3.a) self-referential method call using ':' - [current] print; # 3.b) self-referential method call using 'nx::current' - [current object] print; # 3.c) self-referential method call using 'nx::current object' - } - :show -}}] +}] [manpage_end]