Index: TODO =================================================================== diff -u -N -r9dadb4297ee2e6b648f14674b79f8ef678fbb8fb -r5c37eb1cd2b674337c60deeef1ecef4b663fa5ce --- TODO (.../TODO) (revision 9dadb4297ee2e6b648f14674b79f8ef678fbb8fb) +++ TODO (.../TODO) (revision 5c37eb1cd2b674337c60deeef1ecef4b663fa5ce) @@ -4053,19 +4053,25 @@ - rename nx::Object.configure to nx::Object.__configure to free method name "configure" for an e.g. tk-like configure - refactored code to allow to parameterize handling of required flag for parameters -- +- don't flag an error when configure is called on an initialized object + (logic: if the object is initialized, configure must have been called + before, and the required action must have been already taken). -doCheckArguments +nx.tcl: +- rename the following internally called methods (not for XOTcl). + alloc -> __alloc + dealloc -> __dealloc + objectparameter -> __objectparameter + recrate -> __recreate +- from these methods, only __objectparameter is defined per default, + the others are defined on demand -#define NSF_ARGPARSE_CHECK 0x0001 -#define NSF_ARGPARSE_FORCE_REQUIRED 0x0002 -#define NSF_ARGPARSE_METHOD_PUSH 0x0100 -#define NSF_ARGPARSE_BUILTIN (NSF_ARGPARSE_CHECK|NSF_ARGPARSE_FORCE_REQUIRED) - - - ======================================================================== TODO: +- handling of method names in nsfAPI.h. The following + ? {o __alloc x} {method __alloc not dispatched on valid class} + should be + ? {o __alloc x} {method alloc not dispatched on valid class} - document "private property" Index: library/nx/nx.tcl =================================================================== diff -u -N -r1f666096846419774da5ef6c42150ae1388ba3cd -r5c37eb1cd2b674337c60deeef1ecef4b663fa5ce --- library/nx/nx.tcl (.../nx.tcl) (revision 1f666096846419774da5ef6c42150ae1388ba3cd) +++ library/nx/nx.tcl (.../nx.tcl) (revision 5c37eb1cd2b674337c60deeef1ecef4b663fa5ce) @@ -46,15 +46,15 @@ # First create the ::nx object system. The internally called methods, # which are not defined by in this script, must have method handles # included. The methods "create", "configure", "destroy", "move" and - # "objectparameter" are defined in this script (either scripted, or - # aliases). + # "__objectparameter" are defined in this script (either scripted, or + # via alias). # ::nsf::objectsystem::create ::nx::Object ::nx::Class { - -class.alloc {alloc ::nsf::methods::class::alloc} + -class.alloc {__alloc ::nsf::methods::class::alloc} -class.create create - -class.dealloc {dealloc ::nsf::methods::class::dealloc} - -class.objectparameter objectparameter - -class.recreate {recreate ::nsf::methods::class::recreate} + -class.dealloc {__dealloc ::nsf::methods::class::dealloc} + -class.objectparameter __objectparameter + -class.recreate {__recreate ::nsf::methods::class::recreate} -object.configure __configure -object.defaultmethod {defaultmethod ::nsf::methods::object::defaultmethod} -object.destroy destroy @@ -125,11 +125,11 @@ # # Use method::provide for base methods in case they are overloaded # with scripted counterparts - ::nsf::method::provide alloc {::nsf::method::alias alloc ::nsf::methods::class::alloc} - ::nsf::method::provide dealloc {::nsf::method::alias dealloc ::nsf::methods::class::dealloc} - ::nsf::method::provide recreate {::nsf::method::alias recreate ::nsf::methods::class::recreate} + ::nsf::method::provide __alloc {::nsf::method::alias __alloc ::nsf::methods::class::alloc} + ::nsf::method::provide __dealloc {::nsf::method::alias __dealloc ::nsf::methods::class::dealloc} + ::nsf::method::provide __recreate {::nsf::method::alias __recreate ::nsf::methods::class::recreate} ::nsf::method::provide __configure {::nsf::method::alias __configure ::nsf::methods::object::configure} - ::nsf::method::provide unknown {::nsf::method::alias unknown ::nsf::methods::object::unknown} + ::nsf::method::provide unknown {::nsf::method::alias unknown ::nsf::methods::object::unknown} # # The method __resolve_method_path resolves a space separated path @@ -321,7 +321,7 @@ # Provide a placeholder for objectparameter during the bootup # process. The real definition is based on slots, which are not # available at this point. - Class protected method objectparameter {} {;} + Class protected method __objectparameter {} {;} ###################################################################### # Define forward methods @@ -728,7 +728,7 @@ if {[info exists name]} { return [: ::nsf::methods::class::info::objectparameter parameter $name] } - return [:objectparameter] + return [:__objectparameter] } :method "info parameter list" {name:optional} { set cmd [list ::nsf::methods::class::info::objectparameter list] @@ -1290,7 +1290,7 @@ # Define objectparameter method ###################################################################### - Class protected method objectparameter {} { + Class protected method __objectparameter {} { # # Collect the object parameter slots in per-position lists to # ensure partial ordering and avoid sorting. Index: library/xotcl/library/xotcl2.tcl =================================================================== diff -u -N -r1f666096846419774da5ef6c42150ae1388ba3cd -r5c37eb1cd2b674337c60deeef1ecef4b663fa5ce --- library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision 1f666096846419774da5ef6c42150ae1388ba3cd) +++ library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision 5c37eb1cd2b674337c60deeef1ecef4b663fa5ce) @@ -929,7 +929,7 @@ # explicitly to slots for backward compatibility ... # :public alias unknown ::nsf::classes::xotcl::Class::unknown - :public method objectparameter {} { + :public method __objectparameter {} { set parameterdefinitions [list] set slots [nsf::directdispatch [self] \ ::nsf::methods::class::info::slotobjects \ Index: tests/disposition.test =================================================================== diff -u -N -r596740edb4c78b485d152175cc165d424a5a8369 -r5c37eb1cd2b674337c60deeef1ecef4b663fa5ce --- tests/disposition.test (.../disposition.test) (revision 596740edb4c78b485d152175cc165d424a5a8369) +++ tests/disposition.test (.../disposition.test) (revision 5c37eb1cd2b674337c60deeef1ecef4b663fa5ce) @@ -28,7 +28,7 @@ set :objectparams $spec ::nsf::invalidateobjectparameter [current] } - :class method objectparameter {} { + :class method __objectparameter {} { return ${:objectparams} } :setObjectParams "" @@ -326,7 +326,7 @@ set :objectparams $spec ::nsf::invalidateobjectparameter [current] } - :class method objectparameter {} { + :class method __objectparameter {} { return ${:objectparams} } :public method foo {args} { @@ -389,7 +389,7 @@ set :objectparams $spec ::nsf::invalidateobjectparameter [current] } - :class method objectparameter {} { + :class method __objectparameter {} { return ${:objectparams} } } @@ -456,7 +456,7 @@ set :objectparams $spec ::nsf::invalidateobjectparameter [current] } - :class method objectparameter {} { + :class method __objectparameter {} { return ${:objectparams} } } @@ -517,7 +517,7 @@ Callee public class method run {} { set self [self] - set objparams [:objectparameter] + set objparams [:__objectparameter] # # The ? helper by default performs a [namespace eval] in the :: # namespace, so the uplevel|upvar would happen in a different, @@ -627,7 +627,7 @@ set :objectparams $spec ::nsf::invalidateobjectparameter [current] } - :class method objectparameter {} { + :class method __objectparameter {} { return ${:objectparams} } :public method foo {args} { @@ -771,7 +771,7 @@ set :objectparams $spec ::nsf::invalidateobjectparameter [current] } - :class method objectparameter {} { + :class method __objectparameter {} { return ${:objectparams} } } @@ -789,7 +789,7 @@ set :objectparams $spec ::nsf::invalidateobjectparameter [current] } - :class method objectparameter {} { + :class method __objectparameter {} { return ${:objectparams} } :public method Residualargs args { @@ -882,7 +882,7 @@ set :objectparams $spec ::nsf::invalidateobjectparameter [current] } - :class method objectparameter {} { + :class method __objectparameter {} { return ${:objectparams} } :method init {} { @@ -906,7 +906,7 @@ set :objectparams $spec ::nsf::invalidateobjectparameter [current] } - :class method objectparameter {} { + :class method __objectparameter {} { if {[info exists :objectparams]} { return ${:objectparams} } @@ -1111,7 +1111,7 @@ set :objectparams $spec ::nsf::invalidateobjectparameter [current] } - :class method objectparameter {} { + :class method __objectparameter {} { if {[info exists :objectparams]} { return ${:objectparams} } @@ -1209,7 +1209,7 @@ set :objectparams $spec ::nsf::invalidateobjectparameter [current] } - :class method objectparameter {} { + :class method __objectparameter {} { if {[info exists :objectparams]} { return ${:objectparams} } Index: tests/method-require.test =================================================================== diff -u -N -r59e100d383b22ea1407f5e5c40e303f2c6bb9027 -r5c37eb1cd2b674337c60deeef1ecef4b663fa5ce --- tests/method-require.test (.../method-require.test) (revision 59e100d383b22ea1407f5e5c40e303f2c6bb9027) +++ tests/method-require.test (.../method-require.test) (revision 5c37eb1cd2b674337c60deeef1ecef4b663fa5ce) @@ -125,6 +125,6 @@ nx::Test case method-require-scope { nx::Object create o - ::nsf::method::require o alloc - ? {o alloc x} {method alloc not dispatched on valid class} + ::nsf::method::require o __alloc + ? {o __alloc x} {method alloc not dispatched on valid class} } Index: tests/object-system.test =================================================================== diff -u -N -r1f666096846419774da5ef6c42150ae1388ba3cd -r5c37eb1cd2b674337c60deeef1ecef4b663fa5ce --- tests/object-system.test (.../object-system.test) (revision 1f666096846419774da5ef6c42150ae1388ba3cd) +++ tests/object-system.test (.../object-system.test) (revision 5c37eb1cd2b674337c60deeef1ecef4b663fa5ce) @@ -18,7 +18,7 @@ } } -? {::nsf::configure objectsystem} "{::nx::Object ::nx::Class {-class.alloc alloc -class.create create -class.dealloc dealloc -class.objectparameter objectparameter -class.recreate recreate -object.configure __configure -object.defaultmethod defaultmethod -object.destroy destroy -object.init init -object.move move -object.unknown unknown}}" +? {::nsf::configure objectsystem} "{::nx::Object ::nx::Class {-class.alloc __alloc -class.create create -class.dealloc __dealloc -class.objectparameter __objectparameter -class.recreate __recreate -object.configure __configure -object.defaultmethod defaultmethod -object.destroy destroy -object.init init -object.move move -object.unknown unknown}}" ? {::nsf::object::exists nx::Object} 1 ? {::nsf::object::property nx::Object initialized} 1 Index: tests/parameters.test =================================================================== diff -u -N -r1f666096846419774da5ef6c42150ae1388ba3cd -r5c37eb1cd2b674337c60deeef1ecef4b663fa5ce --- tests/parameters.test (.../parameters.test) (revision 1f666096846419774da5ef6c42150ae1388ba3cd) +++ tests/parameters.test (.../parameters.test) (revision 5c37eb1cd2b674337c60deeef1ecef4b663fa5ce) @@ -273,11 +273,11 @@ } C create c1 - ? {C eval :objectparameter} \ + ? {C eval :__objectparameter} \ "-a -b:boolean {-c 1} -volatile:alias,noarg -properties:alias,method=::nx::internal::addProperties -noinit:alias,method=::nsf::methods::object::noinit,noarg -mixin:mixinreg,alias,0..n -class:class,alias,method=::nsf::methods::object::class -filter:filterreg,alias,0..n __initcmd:initcmd,optional,noleadingdash" - ? {c1 eval :objectparameter} \ - "::c1: unable to dispatch method 'objectparameter'" + ? {c1 eval :__objectparameter} \ + "::c1: unable to dispatch method '__objectparameter'" } ####################################################### @@ -304,7 +304,7 @@ ? {d1 info lookup slots -source application} \ "::D::slot::d ::C::slot::a ::C::slot::b ::C::slot::c" - ? {D eval :objectparameter} \ + ? {D eval :__objectparameter} \ "-d:required -a -b:boolean {-c 1} -volatile:alias,noarg -properties:alias,method=::nx::internal::addProperties -noinit:alias,method=::nsf::methods::object::noinit,noarg -mixin:mixinreg,alias,0..n -class:class,alias,method=::nsf::methods::object::class -filter:filterreg,alias,0..n __initcmd:initcmd,optional,noleadingdash" } @@ -333,29 +333,29 @@ } D mixin M - ? {D eval :objectparameter} \ + ? {D eval :__objectparameter} \ "-b -m1 -m2 -d:required -a {-c 1} -volatile:alias,noarg -properties:alias,method=::nx::internal::addProperties -noinit:alias,method=::nsf::methods::object::noinit,noarg -mixin:mixinreg,alias,0..n -class:class,alias,method=::nsf::methods::object::class -filter:filterreg,alias,0..n __initcmd:initcmd,optional,noleadingdash" \ "mixin added" M mixin M2 - ? {D eval :objectparameter} \ + ? {D eval :__objectparameter} \ "-b2 -b -m1 -m2 -d:required -a {-c 1} -volatile:alias,noarg -properties:alias,method=::nx::internal::addProperties -noinit:alias,method=::nsf::methods::object::noinit,noarg -mixin:mixinreg,alias,0..n -class:class,alias,method=::nsf::methods::object::class -filter:filterreg,alias,0..n __initcmd:initcmd,optional,noleadingdash" \ "transitive mixin added" D mixin "" #we should have again the old interface - ? {D eval :objectparameter} \ + ? {D eval :__objectparameter} \ "-d:required -a -b:boolean {-c 1} -volatile:alias,noarg -properties:alias,method=::nx::internal::addProperties -noinit:alias,method=::nsf::methods::object::noinit,noarg -mixin:mixinreg,alias,0..n -class:class,alias,method=::nsf::methods::object::class -filter:filterreg,alias,0..n __initcmd:initcmd,optional,noleadingdash" C mixin M - ? {D eval :objectparameter} \ + ? {D eval :__objectparameter} \ "-b2 -b -m1 -m2 -d:required -a {-c 1} -volatile:alias,noarg -properties:alias,method=::nx::internal::addProperties -noinit:alias,method=::nsf::methods::object::noinit,noarg -mixin:mixinreg,alias,0..n -class:class,alias,method=::nsf::methods::object::class -filter:filterreg,alias,0..n __initcmd:initcmd,optional,noleadingdash" \ "mixin added" C mixin "" #we should have again the old interface - ? {D eval :objectparameter} \ + ? {D eval :__objectparameter} \ "-d:required -a -b:boolean {-c 1} -volatile:alias,noarg -properties:alias,method=::nx::internal::addProperties -noinit:alias,method=::nsf::methods::object::noinit,noarg -mixin:mixinreg,alias,0..n -class:class,alias,method=::nsf::methods::object::class -filter:filterreg,alias,0..n __initcmd:initcmd,optional,noleadingdash" } @@ -531,7 +531,7 @@ ? {Bar property ss:switch} "::nsf::classes::Bar::ss" Bar create bar1 - #puts stderr [bar1 objectparameter] + #puts stderr [bar1 __objectparameter] ? {subst {[bar1 s]-[bar1 literal]-[bar1 c]-[bar1 d]}} \ {::bar1-[current]-::Bar-literal $d} \ @@ -1845,7 +1845,7 @@ ? {C info slot objects -closure} "::C::slot::a1 ::nx::Object::slot::volatile ::nx::Object::slot::properties ::nx::Object::slot::noinit ::nx::Object::slot::mixin ::nx::Object::slot::__initcmd ::nx::Object::slot::class ::nx::Object::slot::filter" - ? {C eval :objectparameter} "-a1 -volatile:alias,noarg -properties:alias,method=::nx::internal::addProperties -noinit:alias,method=::nsf::methods::object::noinit,noarg -mixin:mixinreg,alias,0..n -class:class,alias,method=::nsf::methods::object::class -filter:filterreg,alias,0..n __initcmd:initcmd,optional,noleadingdash" + ? {C eval :__objectparameter} "-a1 -volatile:alias,noarg -properties:alias,method=::nx::internal::addProperties -noinit:alias,method=::nsf::methods::object::noinit,noarg -mixin:mixinreg,alias,0..n -class:class,alias,method=::nsf::methods::object::class -filter:filterreg,alias,0..n __initcmd:initcmd,optional,noleadingdash" # # invalidate object parameter and expect that the per-class mixin @@ -1859,7 +1859,7 @@ ? {C info slot objects -closure} "::C::slot::a1 ::nx::Object::slot::volatile ::nx::Object::slot::properties ::nx::Object::slot::noinit ::nx::Object::slot::mixin ::nx::Object::slot::__initcmd ::nx::Object::slot::class ::nx::Object::slot::filter" - ? {C eval :objectparameter} "-a1 -volatile:alias,noarg -properties:alias,method=::nx::internal::addProperties -noinit:alias,method=::nsf::methods::object::noinit,noarg -mixin:mixinreg,alias,0..n -class:class,alias,method=::nsf::methods::object::class -filter:filterreg,alias,0..n __initcmd:initcmd,optional,noleadingdash" + ? {C eval :__objectparameter} "-a1 -volatile:alias,noarg -properties:alias,method=::nx::internal::addProperties -noinit:alias,method=::nsf::methods::object::noinit,noarg -mixin:mixinreg,alias,0..n -class:class,alias,method=::nsf::methods::object::class -filter:filterreg,alias,0..n __initcmd:initcmd,optional,noleadingdash" # should not require b1 ? {C create c2} ::c2 @@ -2443,7 +2443,7 @@ set :objectparams $spec ::nsf::invalidateobjectparameter [self] } - :class method objectparameter {} { + :class method __objectparameter {} { return ${:objectparams} } :setObjectParams ""