Clone
Gustaf Neumann <neumann@wu-wien.ac.at>
committed
on 06 Oct
New feature: Added method nx::Object->"info consts"
A "const" is a variable that cannot be altered later. So far, such
constant variables h… Show more
New feature: Added method nx::Object->"info consts"

A "const" is a variable that cannot be altered later.  So far, such

constant variables have to be created via the Tcl9 "const" cmd, like

in the example below.  The introspection method "/obj/ info consts" is

very similar to "/obj/ info vars", but it lists only unmodifiable

variables.

   nx::Object create o {

     #

     # Create a "const" instance variable

     #

     const :x 1

     set :y 2

     ...

   }

   puts [o info consts]

   puts [o info vars]

Show less