protected.test

Clone Tools
  • last updated 11 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
align names (use "subclass" instead of "sub-class")

* nsf.c (ObjectCmdMethodDispatch), protected.test: For ensemble (submethod) dispatches, since ever, call protection had not been enforced at all. This commit enables call protection (protected) for ensembles and adds basic tests. * nsfStack.c (GetSelfObj): To allow one to resolve the self reference at arbitrary callstack levels, separate GetSelfObj into GetSelfObj (macro) for the topmost self and GetSelfObj2.

  1. … 2 more files in changeset.
nx::Class unknown: rewritte unknown message to include '?...?'

  1. … 5 more files in changeset.
Tests: Adjust the test suite for the latest rewording of the nx::Class unknown message

  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.
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.
- enforce using "set" for filter/object-filter in slot operations (same as for mixins)

  1. … 10 more files in changeset.
- finalize dropping of setter methods for nx

  1. … 9 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::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: handle "incremental" in slot reconfigure - nx.tcl: change defaultAccessor to "none"

  1. … 20 more files in changeset.
- added "/obj/ object variable" and "/obj/ object property"

  1. … 8 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.
Property reform part 1:

- disallow protection modifiers for "properties" and

add new flag "-accessor" to "property" and "variable"

This changes definitions like

Class create C {

:property {a a1}

:public property {b b1}

:protected property {c c1}

:private property {d d1}

}

to

Class create C {

:property {a a1}

:property -accessor public {b b1}

:property -accessor protected {c c1}

:property -accessor private {d d1}

}

since "properties" are always public accessible

over the "configure" and "cget" interface, but the

accessors methods might not be public. The value of

the accessor might be also "none" (specifying explicitely

that no accessor is wanted) or "", which means: use the default.

Same holds for "variable"

- disallow parameter option "incremental" and change it to a flag

of the property or variable. The motivation for this is due to

the fact, that "incremental" is a property of the accessor, and

not of the value.

old:

Class create C {

:property foo:int,incremental

:variable bar:int,incremental

}

new:

Class create C {

:property -incremental foo:int

:variable -incremental bar:int

}

- disallow "public class property" and friends since these are not needed

- removed parameter property "noaccessor"

- removed "nx::configure defaultPropertyCallProtection" and

method hook "__default_property_call_protection"

- introduced "nx::configure defaultAccessor" and

method hook "__default_accessor"

- for the time being, "defaultAccessor" is "public" for NX and XOTcl,

will be changed to "none" in NX

- extended regression test (new file properties.test)

  1. … 16 more files in changeset.
- document private properties in tutorial and migration guide - improve wording in documenting - extend regression test

  1. … 5 more files in changeset.
- minor polishing

- start error messages with a lower case word for consistency and to follow closer to Tcl's conventions

  1. … 6 more files in changeset.
- improve error message to indicate, that nsf refuses to overwrite (redefine) some cmds

  1. … 2 more files in changeset.
- fixed potential crash from method caching, when permissions on cmds are changed and become e.g. unresolvable - removed flag allowmethoddispatch, since behavior can be achived via private flag. - extended regression test

  1. … 9 more files in changeset.
- nsf.c: start all error messages with a lower case word for consistency and to follow closer to Tcl's conventions

  1. … 14 more files in changeset.
- rename "info method handle /methodName/" into "info method registrationhandle /methodName/" - rename "info method origin /methodName/" into "info method definitionhandle /methodName/" - added "info method origin" to return the target of an alias (or empty)

  1. … 19 more files in changeset.
- nsf.c: make ":" a full equivalent vor nsf::my (i.e. support -local, -system and -intrinsic) - extend regression test

  1. … 4 more files in changeset.
- nsf.c: * added permissable value "private" to flag "-callprotection" for "info lookup method" and "info methods". * extended regression test

  1. … 5 more files in changeset.
- nsf.c: * "private" implies now "protected". This means, setting "private" sets as well "protected", unsetting "protected" unsets "private" * make sure the "... method definition" of private methods is returned as "private" * extended regression test

  1. … 3 more files in changeset.
- made nsf::my and nsf::object::dispatch available in the nx namespace

  1. … 4 more files in changeset.
* removed "-local", "-system" and "-intrinsic" from plain dispatch (like e.g. "o1 -system method") * removed flag "-local" from nsf::object::dispatch

  1. … 5 more files in changeset.
* added support for calling private methods via -local and filters * extended regression test for private + filters

  1. … 6 more files in changeset.
- nsf.c: * allow protected and private methods to be used as filters * added regression tests * some cleanup in regression tests

  1. … 2 more files in changeset.
- remove interp from MEM_COUNT implementation

  1. … 3 more files in changeset.
* added transparency for per-object private methods * extended regression test

  1. … 2 more files in changeset.