Index: TODO =================================================================== diff -u -rf69de2050abfb8d71c92588c4d42d0cc1ea39aaf -re0419345b49587b5738f87c6d828dfc5ae4b3276 --- TODO (.../TODO) (revision f69de2050abfb8d71c92588c4d42d0cc1ea39aaf) +++ TODO (.../TODO) (revision e0419345b49587b5738f87c6d828dfc5ae4b3276) @@ -4578,20 +4578,21 @@ by using nx::configure trait-verbosity on|off +nx.tcl: +- renamed variable option "-config" to "-configurable" + to make its intention clearer + ======================================================================== TODO: - reconsider #? {c1 cget -mixin} "" ? {c1 cget -object-mixin} "" -- reconsider lower multiplicty on +- reconsider lower multiplicity on -object-mixin, -mixin... -- maybe rename nonpos arg "-config" of property/variable - to "-configurable"? (pro: more clearly, contra: longer) - do we need "config" as parameter property? - handling of "required" in reconfigure (see parameter-object-mixin-dependency in parameters.test) - handling of recreate (see regression test for class-level properties) Index: doc/example-scripts/container.tcl =================================================================== diff -u -re884c2b0d63fa1b5a691e866ccff8d4094a2a8e4 -re0419345b49587b5738f87c6d828dfc5ae4b3276 --- doc/example-scripts/container.tcl (.../container.tcl) (revision e884c2b0d63fa1b5a691e866ccff8d4094a2a8e4) +++ doc/example-scripts/container.tcl (.../container.tcl) (revision e0419345b49587b5738f87c6d828dfc5ae4b3276) @@ -129,14 +129,14 @@ :variable values {} :variable index {} - :property key + :public method index {} { return ${:index}} :public method new {args} { set item [${:memberClass} create [:]::[:autoname ${:prefix}] {*}$args] if {[info exists :key]} { - set value [$item ${:key}] + set value [$item cget -${:key}] set pos [lsearch -bisect ${:values} $value] set :values [linsert ${:values} [expr {$pos + 1}] $value] set :index [linsert ${:index} [expr {$pos + 1}] $item] @@ -154,7 +154,6 @@ set :index [lreplace ${:index} $pos $pos] next } - } # Create a container for class +D+ with key +name+: Index: doc/next-migration.html =================================================================== diff -u -rea3bbe8b1039c45baa2c027c005151e04e57d4b1 -re0419345b49587b5738f87c6d828dfc5ae4b3276 --- doc/next-migration.html (.../next-migration.html) (revision ea3bbe8b1039c45baa2c027c005151e04e57d4b1) +++ doc/next-migration.html (.../next-migration.html) (revision e0419345b49587b5738f87c6d828dfc5ae4b3276) @@ -4621,18 +4621,20 @@ /obj/ info lookup configure parameters ?pattern? + # "info lookup configure syntax" returns syntax of # a call to configure in the Tcl parameter syntax /obj/ info lookup configure syntax +# short form +/obj/ info configure # Obtain information from a parameter # (as e.g. returned from "info configure # parameters"). /obj/ info parameter name /parameter/ -/obj/ info parameter syntax /parameter/ - +/obj/ info parameter syntax /parameter/ @@ -6272,7 +6274,7 @@ Index: doc/next-migration.txt =================================================================== diff -u -rea3bbe8b1039c45baa2c027c005151e04e57d4b1 -re0419345b49587b5738f87c6d828dfc5ae4b3276 --- doc/next-migration.txt (.../next-migration.txt) (revision ea3bbe8b1039c45baa2c027c005151e04e57d4b1) +++ doc/next-migration.txt (.../next-migration.txt) (revision e0419345b49587b5738f87c6d828dfc5ae4b3276) @@ -2159,18 +2159,20 @@ /obj/ info lookup configure parameters ?pattern? + # "info lookup configure syntax" returns syntax of # a call to configure in the Tcl parameter syntax /obj/ info lookup configure syntax +# short form +/obj/ info configure # Obtain information from a parameter # (as e.g. returned from "info configure # parameters"). /obj/ info parameter name /parameter/ /obj/ info parameter syntax /parameter/ - ---------------- |====================== Index: doc/next-tutorial/slots.graffle =================================================================== diff -u -r2f6bcca3537584c8ef1f9fc71b230e79d1560504 -re0419345b49587b5738f87c6d828dfc5ae4b3276 --- doc/next-tutorial/slots.graffle (.../slots.graffle) (revision 2f6bcca3537584c8ef1f9fc71b230e79d1560504) +++ doc/next-tutorial/slots.graffle (.../slots.graffle) (revision e0419345b49587b5738f87c6d828dfc5ae4b3276) @@ -7,7 +7,7 @@ ApplicationVersion com.omnigroup.OmniGrafflePro - 139.16.0.171715 + 139.7.0.167456 AutoAdjust @@ -65,8 +65,8 @@ 129 Points - {317.22199999999998, 429.36153899148525} - {196.13920000000002, 308.91911503050011} + {317.22199999999998, 429.32791353754141} + {196.13920000000002, 308.83987271990873} Style @@ -102,8 +102,8 @@ 128 Points - {106.8858400404699, 432.88299999999998} - {106.88589312914517, 409} + {106.88579015298748, 432.88299999999998} + {106.88582432955573, 409} Style @@ -679,8 +679,8 @@ 90 Points - {122.38148119767141, 635.89999999999986} - {113.85795765929126, 558.88300000000004} + {122.38148080033758, 635.89999999999986} + {113.85795490799903, 558.88300000000004} Style @@ -802,8 +802,8 @@ 88 Points - {106.88571180743048, 597.48299999999995} - {106.8857468664164, 558.88300000000004} + {106.88570184457316, 597.48299999999995} + {106.88570732153661, 558.88300000000004} Style @@ -839,8 +839,8 @@ 87 Points - {352.01146605391102, 148.30099999999999} - {287.24460912688153, 39.584100000000007} + {352.01146512998173, 148.30099999999999} + {287.2446029162823, 39.584100000000007} Style @@ -994,8 +994,8 @@ 85 Points - {196.13920000000002, 119.99154186866068} - {267.8995865405019, 39.584099999999992} + {196.13920000000002, 119.99070764884014} + {267.89824345555076, 39.584100000000007} Style @@ -1478,7 +1478,7 @@ forwardername\ defaultmethods \{get assign)\ accessor false\ -config true\ +configurable true\ noarg\ noleadingdash\ disposition alias\ @@ -1605,9 +1605,9 @@ MasterSheets ModificationDate - 2013-05-28 14:40:56 +0000 + 2013-06-01 16:42:39 +0000 Modifier - Gustaf Neumann + Gustaf A. Neumann NotesVisible NO Orientation @@ -1638,11 +1638,6 @@ float 12 - NSOrientation - - coded - BAtzdHJlYW10eXBlZIHoA4QBQISEhAhOU051bWJlcgCEhAdOU1ZhbHVlAISECE5TT2JqZWN0AIWEASqEhAFxlwCG - NSPagesPerSheet int @@ -1718,7 +1713,7 @@ SidebarWidth 138 VisibleRegion - {{-22.022840097881307, -78.0228400978813}, {862.83219357080509, 877.48959210258545}} + {{-145.0228400978813, -29.022840097881307}, {862.83219357080509, 877.48959210258545}} Zoom 1.0233739614486694 ZoomValues Index: doc/next-tutorial/slots.png =================================================================== diff -u -r2f6bcca3537584c8ef1f9fc71b230e79d1560504 -re0419345b49587b5738f87c6d828dfc5ae4b3276 Binary files differ Index: generic/nsf.c =================================================================== diff -u -r7ba7b3c49ff542688258f50fba2fc8102f23a011 -re0419345b49587b5738f87c6d828dfc5ae4b3276 --- generic/nsf.c (.../nsf.c) (revision 7ba7b3c49ff542688258f50fba2fc8102f23a011) +++ generic/nsf.c (.../nsf.c) (revision e0419345b49587b5738f87c6d828dfc5ae4b3276) @@ -21175,7 +21175,7 @@ if (withConfigure) { int configure = 0; Tcl_Obj *configureObj = Nsf_ObjGetVar2((Nsf_Object *)slotObject, interp, - NsfGlobalObjs[NSF_CONFIG], NULL, 0); + NsfGlobalObjs[NSF_CONFIGURABLE], NULL, 0); if (!configureObj) continue; Tcl_GetBooleanFromObj(interp, configureObj, &configure); if (!configure) continue; Index: generic/nsfInt.h =================================================================== diff -u -r2f6bcca3537584c8ef1f9fc71b230e79d1560504 -re0419345b49587b5738f87c6d828dfc5ae4b3276 --- generic/nsfInt.h (.../nsfInt.h) (revision 2f6bcca3537584c8ef1f9fc71b230e79d1560504) +++ generic/nsfInt.h (.../nsfInt.h) (revision e0419345b49587b5738f87c6d828dfc5ae4b3276) @@ -630,7 +630,7 @@ NSF_AUTONAMES, NSF_DEFAULTMETACLASS, NSF_DEFAULTSUPERCLASS, NSF_ARRAY_INITCMD, NSF_ARRAY_CMD, NSF_ARRAY_ALIAS, NSF_ARRAY_PARAMETERSYNTAX, - NSF_POSITION, NSF_POSITIONAL, NSF_CONFIG, NSF_PARAMETERSPEC, + NSF_POSITION, NSF_POSITIONAL, NSF_CONFIGURABLE, NSF_PARAMETERSPEC, /* object/class names */ NSF_METHOD_PARAMETER_SLOT_OBJ, /* constants */ @@ -652,7 +652,7 @@ /* var names */ "__autonames", "__default_metaclass", "__default_superclass", "__initcmd", "__cmd", "::nsf::alias", "::nsf::parameter::syntax", - "position", "positional", "config", "parameterSpec", + "position", "positional", "configurable", "parameterSpec", /* object/class names */ "::nx::methodParameterSlot", /* constants */ Index: library/nx/nx.tcl =================================================================== diff -u -r7ba7b3c49ff542688258f50fba2fc8102f23a011 -re0419345b49587b5738f87c6d828dfc5ae4b3276 --- library/nx/nx.tcl (.../nx.tcl) (revision 7ba7b3c49ff542688258f50fba2fc8102f23a011) +++ library/nx/nx.tcl (.../nx.tcl) (revision e0419345b49587b5738f87c6d828dfc5ae4b3276) @@ -977,7 +977,7 @@ if {$property eq "convert" } {set class [:requireClass ::nx::VariableSlot $class]} lappend opts -$property 1 } elseif {$property eq "noconfig"} { - set opt(-config) 0 ;# TODO + set opt(-configurable) 0 ;# TODO } elseif {$property eq "incremental"} { error "parameter option incremental must not be used; use non-positional argument -incremental instead" } elseif {[string match type=* $property]} { @@ -1103,7 +1103,7 @@ # set for every bootstrap property slot the position 0 # ::nsf::var::set $slotObj position 0 - ::nsf::var::set $slotObj config 1 + ::nsf::var::set $slotObj configurable 1 } #puts stderr "Bootstrap-slot for $class calls parameter:invalidate::classcache" @@ -1185,7 +1185,7 @@ {defaultmethods {get assign}} {accessor public} {incremental:boolean false} - {config true} + {configurable true} {noarg} {noleadingdash} {disposition alias} @@ -1368,12 +1368,12 @@ } ObjectParameterSlot public method getPropertyDefinitionOptions {parameterSpec} { - #puts "accessor <${:accessor}> config ${:config} per-object ${:per-object}" + #puts "accessor <${:accessor}> configurable ${:configurable} per-object ${:per-object}" set mod [expr {${:per-object} ? "object" : ""}] set opts "" - if {${:config}} { + if {${:configurable}} { lappend opts -accessor ${:accessor} if {${:incremental}} {lappend opts -incremental} if {[info exists :default]} { @@ -1382,7 +1382,7 @@ set methodName property } else { lappend opts -accessor ${:accessor} - if {${:config}} {lappend opts -config true} + if {${:configurable}} {lappend opts -configurable true} if {[info exists :default]} { return [list ${:domain} {*}$mod variable {*}$opts $parameterSpec ${:default}] } @@ -1394,7 +1394,7 @@ ObjectParameterSlot public method definition {} { set options [:getParameterOptions -withMultiplicity true] if {[info exists :positional]} {lappend options positional} - #if {!${:config}} {lappend options noconfig} + #if {!${:configurable}} {lappend options noconfig} return [:getPropertyDefinitionOptions [:namedParameterSpec -map-private "" ${:name} $options]] } @@ -1725,7 +1725,7 @@ if {[info exists :substdefault] && ${:substdefault}} { lappend options substdefault } - if {[info exists :config] && !${:config}} { + if {[info exists :configurable] && !${:configurable}} { lappend options noconfig } } @@ -1770,11 +1770,11 @@ if {${:accessor} eq "protected"} { ::nsf::method::property ${:domain} {*}[expr {${:per-object} ? "-per-object" : ""}] \ $handle call-protected true - set :config 0 + set :configurable 0 } elseif {${:accessor} eq "private"} { ::nsf::method::property ${:domain} {*}[expr {${:per-object} ? "-per-object" : ""}] \ $handle call-private true - set :config 0 + set :configurable 0 } elseif {${:accessor} ne "public"} { :destroy error "accessor value '${:accessor}' invalid; might be one of public|protected|private or none" @@ -1978,7 +1978,7 @@ {-accessor "none"} {-incremental:switch} {-class ""} - {-config:boolean false} + {-configurable:boolean false} {-initblock ""} {-nocomplain:switch} spec:parameter @@ -2000,13 +2000,12 @@ name parameterOptions class options array set opts $options - # TODO: do we need config as parameter property? - if {[info exists opts(-config)]} { - set config $opts(-config) + if {[info exists opts(-configurable)]} { + set configurable $opts(-configurable) } #if {$initblock eq "" && $accessor eq "none" && !$incremental} - if {$initblock eq "" && !$config && $accessor eq "none" && !$incremental} { + if {$initblock eq "" && !$configurable && $accessor eq "none" && !$incremental} { # # we can build a slot-less variable # @@ -2054,7 +2053,7 @@ {*}[expr {[info exists defaultValue] ? [list $defaultValue] : ""}]] if {$nocomplain} {$slot eval {set :nocomplain 1}} - if {!$config} {$slot eval {set :config false}} + if {!$configurable} {$slot eval {set :configurable false}} if {[info exists defaultValue]} { # We could consider calling "configure" instead, but that would # not work for true "variable" handlers @@ -2073,7 +2072,7 @@ Object method "object property" { {-accessor ""} - {-config:boolean true} + {-configurable:boolean true} {-incremental:switch} {-class ""} {-nocomplain:switch} @@ -2091,7 +2090,7 @@ -incremental=$incremental \ -class $class \ -initblock $initblock \ - -config $config \ + -configurable $configurable \ -nocomplain=$nocomplain \ {*}$spec] return $r @@ -2101,7 +2100,7 @@ {-accessor "none"} {-incremental:switch} {-class ""} - {-config:boolean false} + {-configurable:boolean false} {-initblock ""} spec:parameter defaultValue:optional @@ -2111,7 +2110,7 @@ -initblock $initblock \ -incremental=$incremental \ -private=[expr {$accessor eq "private"}] \ - -defaultopts [list -accessor $accessor -config $config] \ + -defaultopts [list -accessor $accessor -configurable $configurable] \ $spec \ {*}[expr {[info exists defaultValue] ? [list $defaultValue] : ""}]] if {[$slot eval {info exists :settername}]} { @@ -2125,7 +2124,7 @@ nx::Class method property { {-accessor ""} - {-config:boolean true} + {-configurable:boolean true} {-incremental:switch} {-class ""} spec:parameter @@ -2140,7 +2139,7 @@ -accessor $accessor \ -incremental=$incremental \ -class $class \ - -config $config \ + -configurable $configurable \ -initblock $initblock \ {*}$spec] return $r Index: tests/object-system.test =================================================================== diff -u -r2f6bcca3537584c8ef1f9fc71b230e79d1560504 -re0419345b49587b5738f87c6d828dfc5ae4b3276 --- tests/object-system.test (.../object-system.test) (revision 2f6bcca3537584c8ef1f9fc71b230e79d1560504) +++ tests/object-system.test (.../object-system.test) (revision e0419345b49587b5738f87c6d828dfc5ae4b3276) @@ -193,6 +193,7 @@ #? {C::slot info vars} __parameter #? {C info attributes} {{x 1} {y 2}} + ? {C info configure parameters x} {{-x 1}} ? {C info configure parameters y} {{-y 2}} Index: tests/parameters.test =================================================================== diff -u -r2f6bcca3537584c8ef1f9fc71b230e79d1560504 -re0419345b49587b5738f87c6d828dfc5ae4b3276 --- tests/parameters.test (.../parameters.test) (revision 2f6bcca3537584c8ef1f9fc71b230e79d1560504) +++ tests/parameters.test (.../parameters.test) (revision e0419345b49587b5738f87c6d828dfc5ae4b3276) @@ -27,7 +27,7 @@ ? {::nsf::method::alias C foo ::set 1} \ {invalid argument '1', maybe too many arguments; should be "::nsf::method::alias /object/ ?-per-object? /methodName/ ?-frame method|object|default? /cmdName/"} - ? {C eval {:property x -class D}} {invalid argument 'D', maybe too many arguments; should be "::C property ?-accessor /value/? ?-config /boolean/? ?-incremental? ?-class /value/? /spec/ ?/initblock/?"} "Test whether the colon prefix is suppressed" + ? {C eval {:property x -class D}} {invalid argument 'D', maybe too many arguments; should be "::C property ?-accessor /value/? ?-configurable /boolean/? ?-incremental? ?-class /value/? /spec/ ?/initblock/?"} "Test whether the colon prefix is suppressed" } ####################################################### Index: tests/properties.test =================================================================== diff -u -r7ba7b3c49ff542688258f50fba2fc8102f23a011 -re0419345b49587b5738f87c6d828dfc5ae4b3276 --- tests/properties.test (.../properties.test) (revision 7ba7b3c49ff542688258f50fba2fc8102f23a011) +++ tests/properties.test (.../properties.test) (revision e0419345b49587b5738f87c6d828dfc5ae4b3276) @@ -31,7 +31,7 @@ :variable -accessor none ve ve1 # a non-configurable property is a variable - :property -accessor none -config false {vf vf1} + :property -accessor none -configurable false {vf vf1} :public method call-local {v} {: -local $v}