Clone
Gustaf Neumann <neumann@wu-wien.ac.at>
committed
on 22 Jun 11
- gentclAPI.tcl: * renamed "nrArgs" to "nrParams" * switched default for nrargs from 0 to 1
library/nx/nx.tcl (+2 -1)
1167 1167       }
1168 1168     }
1169 1169   }
1170 1170
1171 1171   ::nx::Attribute protected method getParameterOptions {{-withMultiplicity 0} {-withSubstdefault 0}} {
1172 1172     set options ""
1173 1173     if {[info exists :type]} {
1174 1174       if {[string match ::* ${:type}]} {
1175 1175         lappend options [expr {[::nsf::is metaclass ${:type}] ? "class" : "object"}] type=${:type}
1176 1176       } else {
1177 1177         lappend options ${:type}
1178 1178         if {${:type} ni [list "" "boolean" "integer" "object" "class" \
1179 1179                              "metaclass" "baseclass" "parameter" \
1180 1180                              "alnum" "alpha" "ascii" "control" "digit" "double" \
1181 1181                              "false" "graph" "lower" "print" "punct" "space" "true" \
1182 1182                              "wideinteger" "wordchar" "xdigit" ]} {
1183 1183           lappend options slot=[::nsf::self]
1184 1184         }
1185 1185       }
1186 1186     }
  1187     if {[info exists :arg]} {lappend options arg=${:arg}}
1187 1188     if {${:required}} {lappend options required}
1188 1189     if {${:convert}} {lappend options convert}
1189 1190     if {$withMultiplicity && [info exists :multiplicity] && ${:multiplicity} ne "1..1"} {
1190 1191       lappend options ${:multiplicity}
1191 1192     }
1192 1193     if {$withSubstdefault && [info exists :substdefault] && ${:substdefault}} {
1193 1194       lappend options substdefault
1194 1195     }
1195       #puts stderr "*** getParameterOptions [self] return $options"
  1196     #puts stderr "*** getParameterOptions [self] returns '$options'"
1196 1197     return $options
1197 1198   }
1198 1199
1199 1200   ::nx::Attribute protected method isMultivalued {} {
1200 1201     return [string match {*..[n*]} ${:multiplicity}]
1201 1202   }
1202 1203
1203 1204   ::nx::Attribute protected method needsForwarder {} {
1204 1205     #
1205 1206     # We just forward, when
1206 1207     #   * "assign" and "add" are still untouched, or
1207 1208     #   * or incremental is specified
1208 1209     #
1209 1210     if {[:info lookup method assign] ne "::nsf::classes::nx::Attribute::assign"} {return 1}
1210 1211     if {[:info lookup method add] ne "::nsf::classes::nx::Attribute::add"} {return 1}
1211 1212     if {[:info lookup method get] ne "::nsf::classes::nx::Attribute::get"} {return 1}
1212 1213     if {![info exists :incremental]} {return 0}
1213 1214     #if {![:isMultivalued]} {return 0}
1214 1215     #puts stderr "[self] ismultivalued"
1215 1216     return 1