michaela
committed
on 15 Jul 15
Fix typo in XOTcl1_ParameterHandler
openacs-4/.../tcl/01-debug-procs.tcl (+1 -1)
132 132   ::xotcl::Object instproc set_instance_vars_defaults {} {
133 133     set pcl [[my info class] info parameterclass]
134 134     $pcl searchDefaults [self]
135 135   }
136 136
137 137   #
138 138   # The XOTcl1_ParameterHandler is for forward compatibility in XOTcl1
139 139   # to allow to load programs with xotcl2/nx value checkers in
140 140   # parameter declarations. The handler simply strips (ignores)
141 141   # xotcl2's parameter declarations.
142 142   #
143 143   namespace eval ::xo {}
144 144   ::xotcl::Class create ::xo::XOTcl1_ParameterHandler
145 145   ::xo::XOTcl1_ParameterHandler instproc __stripped_parameter {element} {
146 146     regexp {^([^:]+):} $element _ element
147 147     return $element
148 148   }
149 149   ::xo::XOTcl1_ParameterHandler instproc parameter {list} {
150 150     set result {}
151 151     foreach element $list {
152         if {$l == [llength $element]} {
  152       if {[llength $element] == 1} {
153 153         lappend result [my __stripped_parameter $element]
154 154       } else {
155 155         lappend result [concat [my __stripped_parameter $element] [lrange $element 1 end]]
156 156       }
157 157     }
158 158     next $result
159 159   }
160 160   ::xotcl::Class instmixin ::xo::XOTcl1_ParameterHandler
161 161 }
162 162
163 163
164 164 namespace eval ::xo {
165 165   ::xo::Attribute instproc init {} {
166 166     my instvar name pretty_name
167 167     next
168 168     # provide a default pretty name for the attribute based on message keys
169 169     if {![info exists pretty_name]} {
170 170       set object_type [my domain]
171 171       if {[regexp {^::([^:]+)::} $object_type _ head]} {
172 172         set tail [namespace tail $object_type]