cget.test

Clone Tools
  • last updated 13 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
improve spelling

  1. … 2 more files in changeset.
- add Tcl_Obj caching to cget argument - redued usage of goto statements - reduced size of largish function

  1. … 1 more file in changeset.
Slot trace reform: - redesign of slot interface of traces from * variables contains cmds and variable references to * slot specific methods with the same interface as slot-setters - new: * specify flag "-trace" with a list of values "get", "set", "default" * when flag is set, a trace will be registered calling methods value=get obj variable value=set obj variable value value=default obj variable on the slot (actually the first two are identical with the methods used for slot-defined accessors) - updated regression test * new flag "-notrace" for "nsf::var::set" and "nsf::var::get"

  1. … 9 more files in changeset.
- Fixed a bug that disallowed the combination of valuecmd and valuechangedcmd for a single property (many thanks to Zoran for pointing this out)

Removed implicit substdefault for configure parameters in nx:

- The syntax of substdefault for method parameters and configure

parameters was different. For method parameters, it was necessary to

specify :substdefault per parameter to activate it, for configure

parameter is was based in the XOTcl tradition on the content of the

default (whether it contains [...]) One problem is, that there was

no easy way to turn this feature off. If one wants to provide a

script block as a default, it was necessary to escape all square

brackets.

- Now, in nx, one has to specify :substdefault for configure

parameter explicitly as well, syntax for configure and method

parameters is the same.

- XOTcl 2.0 keeps implicit substdefaults (backward compatible)

- fix bug: never try to substdefault, when there is no default given.

  1. … 4 more files in changeset.
nx.tcl: pluralism reform part 2 - changed methods /cls/ info subclass -> /cls/ info subclasses /cls/ info superclass -> /cls/ info superclasses /cls/ mixin ... -> /cls/ mixins /cls/ filter ... -> /cls/ filters /cls/ object mixin ... -> /cls/ object mixins /cls/ object filter ... -> /cls/ object filters - changed configure parameters /cls/ configure -mixin -> /cls/ configure -mixins /cls/ configure -filter -> /cls/ configure -filters /obj/ configure -object-mixin -> /obj/ configure -object-mixins /obj/ configure -object-filter -> /obj/ configure -object-filters - added handling for calling relationslot with unknown sub method

  1. … 31 more files in changeset.
nsf.c: - allow abbreaviated nonpos args - change name of relationslot "superclass" to "superclasses". (part of a planned change to use plural for setvalued parameters, "info superclasses" and similar changes for mixins/filters will probably follow)

  1. … 7 more files in changeset.
nsf.c: - added options to filter output from ::nsf::cmd::info parameter options (args, syntax, parameter) - deleted: - "/obj/ info lookup configure parameters ?pattern?" - "/obj/ info lookup configure syntax" - added: - "/obj/ info lookup parameters /methodName/ ?pattern?" - "/obj/ info lookup syntax /methodName/ ?pattern?" This covers as well - "/obj/ info lookup parameters configure|create|new|... ?pattern?" - extend regression test

  1. … 9 more files in changeset.
nx.tcl - drop short form "/obj/ info configure" for now - make output of "/obj/ info lookup configure syntax" equivalent to "/obj/ info configure"

  1. … 6 more files in changeset.
nx.tcl, xotcl2.tcl: - use value=* as names for interally called and forwarder-called accessor methods - disallow "assign" for nx::variableSlots

  1. … 12 more files in changeset.
nx.tcl: - use set/get/add as slot methods for get/configure/incremental operations - demangle slots for nx/xotcl2 further

xotcl2:

- use assign/get/add as slot methods for get/configure/incremental

operations

- use object system configuration for -slot.get and -slot.set

  1. … 8 more files in changeset.
- add flag "-onerror" to nsf::forward::method to handle errors during dispatch of a forwarder (not all error messags of forwarder are already transformed) - added log-level Info which prints always, e.g. for "-verbose" flag of forwarder - drop setter-rule from properties (use always forwarder) - drop "/obj/ /prop/" and "/obj/ /prop/ /value/" in favor of "/obj/ /prop/ get" and "/obj/ /prop/ assign /value/" to achieve better orthogonality with e.g. incremental properties

  1. … 16 more files in changeset.
nsf.c: - fix case, where NsfDStringPrintf() failed (when print llength including \0 was 1 byte longer than print buffer) - make sure, that the list kept for the cached parameter is just built from unshared objects; otherwise Tcl append will abort

nx.tcl:

- new package "nx::volatile"

- don't define configure parameter "-volatile" per default;

use "package req nx::volatile" instead

- don't define per method "volatile" per default;

use "::nsf::method::require ::nx::Object volatile" instead

- get rid of -volatile in nx.tcl and serializer

- update/extend regression test

  1. … 13 more files in changeset.
nsf.c: - change name of enumeratorConverterEntry to Nsf_EnumeratorConverterEntry, move it with NSF_ARG_* flags to tcl.h to make it available in derived modules using the converter - Added editor hints for a more uniform appearance

  1. … 44 more files in changeset.
nx: - allow copy of objects with required arguments - use ::nsf::object::alloc in "copy" method - don't depend on method "trace", use directdispatch instead - remove method "-noinit" (nsf::object::alloc makes it obsolete) - extend regression test

  1. … 7 more files in changeset.
nx::test: - change test cases to newer interface - don't use "namespace import nx::*" in test cases when not required

  1. … 34 more files in changeset.
nx.tcl: - replaced functionality of "/obj/ configure" by "/obj/ info configure" to re-enable semantics of the plain configure method, even when called without arguments. "/obj/ info configure" is actually a convenience method to allow to write o1 info configure instead of o1 info lookup configure syntax

  1. … 7 more files in changeset.
nsf.c - fixed potential inifinite loop in pattern matching for precedence lists - cget: make error message closer to tcl conventions - extended regression test

  1. … 4 more files in changeset.
- renamed initblock parameter from __initcmd to __initblock - renamed nsf::configure parameter from "keepinitcmds" to "keepcmds" - saving "keepcmds" in an associative array named "__cmd(/parameternName)" to allow saving of multiple parmeters with less nameclash danger (when application stays away from variables stating with double underscore)

  1. … 17 more files in changeset.
- added implementation for slots with traces+types for classes - exception for incorrect defaults are thrown during slot creation - extended nsf::is, added parameter * ?-configure? -- accept configure paramter options * ?-name /name/? -- provide a parameter name for error message - simplified nx.tcl by using new nsf::is - extended regression test

  1. … 6 more files in changeset.
- added partly implementation for slots with traces+types for classes

  1. … 3 more files in changeset.
- fixed cases, where valuechangedcmd (and the other traces) did not work with "configure" method. When slot traces are used, it cleans other traces for the same operations. - extended regression test

  1. … 3 more files in changeset.
- nx.tcl: handle "incremental" in slot reconfigure - nx.tcl: change defaultAccessor to "none"

  1. … 20 more files in changeset.
- Method and configure parameter reform

/cls/ info configure parameters ?pattern? -> list of params

/cls/ info configure syntax -> syntax output

/obj/ info method parameters /methodName/ ?/pattern/? -> list of params

/obj/ info method syntax -> syntax output

/obj/ info lookup configure parameter ?/pattern/? -> list of params

/obj/ info lookup configure syntax -> syntax output

/cls/ info parameter list|name|syntax /param/ -> value

  1. … 14 more files in changeset.
- syntax formatter: use /value/ for denoting placeholder in "... info method syntax ..."

  1. … 11 more files in changeset.
- parametersyntax: make placeholders explicit

  1. … 4 more files in changeset.
Object-method Reform: - changed interface to object specific commands by requiring an ensemble named "object". The rational behind is essentially to use always the same info command to retrieve object specific methods, no matter whether these are defined on a plain object or an a class object (does not break the "contract" what e.g. "info method" returns).

Now we define methods via:

/cls/ method foo {args} {...body...}

/cls/ object method foo {args} {...body...}

/obj/ object method foo {args} {...body...}

Similarly, aliases, forwards and mixins are defined, e.g.

/cls/ mixin add ...

/cls/ object mixin add ...

/obj/ object mixin add ...

/obj/ require object method ...

The same change propagated as well to the "info" method.

Now we have:

/cls/ info methods ...

/cls/ info object methods ...

/obj/ info object methods ...

Similar, the object parametererization uses

/cls/ create obj -object-mixin M

/cls/ create obj -object-filter f

/metacls/ create cls -mixin M1 -object-mixin M2

/metacls/ create cls -filter f1 -object-filter f2

- as a consequence,

a) "/cls/ class method ...",

"/cls/ class alias ...",

"/cls/ class forward ...",

"/cls/ class filter ...",

"/cls/ class mixin ...",

"/cls/ class info ..."

"/obj/ class method require method ..."

"/obj/ class method require public method ..."

"/obj/ class method require protected method ..."

"/obj/ class method require private method ..."

were dropped

b) "/obj/ method ....",

"/obj/ alias ....",

"/obj/ forward ...."

"/obj/ filter ...."

"/obj/ mixin ...."

"/obj/ info method*"

"/cls/ create obj -mixin M"

"/cls/ create obj -filter f"

"/obj/ method require method ..."

"/obj/ method require public method ..."

"/obj/ method require protected method ..."

"/obj/ method require private method ..."

were dropped

- added package nx::class to allow optionally the "class" notation

"/cls/ class method ..." (and friends, see (a)), and

"/cls/ class info ...

- added package nx::plain-object-method to allow optionally plain method

b) "/obj/ method ...." (and friends, see (b))

- add support to slots to use ensemble methods as setters

  1. … 43 more files in changeset.
nsf.c: - factored out ParameterMethodForwardDispatch() to call a parameter method defined as a forwarder the smae way from "configure" and "cget" - extended regression test

  1. … 3 more files in changeset.
- extended regression test

  1. … 1 more file in changeset.
- changed name "/obj|cls/ slot info definition" to "/obj|cls/ slot info definition" since result is a set - dropped parameter method "properties" - dropped "/obj/ info properties" (since "properties" or "variables" are returned")

  1. … 8 more files in changeset.
- added functiality for "cget" to call parameter-methods (e.g. "... cget -class"). The method cget calls either "/slot/ get ..." (when slot=... is provided in the parameter spec) or it assumes that the method without argument returns the value - added "::nsf::object::property /obj/ volatile" to query whether a object is volatile or not - "/obj/ cget -volatile" returns now the volatial state of the object - factored out ParameterMethodDispatch() from OConfigureMethod() - extended regression test

  1. … 9 more files in changeset.