nx

Clone Tools
  • last updated 23 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
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.
package nx::class-method: - convenience package similar to nx::plain-object-method - allow for usage "C class method ..." in addition to "C object method". - made warnings configurable via nx::configure class-method-warning on|off - completed coverage and test cases

  1. … 4 more files in changeset.
package nx::plain-object-method: - made warnings configurable via nx::configure plain-object-method-warning on|off - completed coverage and test cases

  1. … 2 more files in changeset.
- prevent default value checking, when it is determined by a command

- completed coverage if plain-object-method.tcl - provide warnings via plain-object-method.tcl via "nsf::log warn ..."

  1. … 2 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.
nx.tcl: - removed "info is .." since it might raise more questions than it solves

  1. … 9 more files in changeset.
- changed ::nsf::parametersyntax(..) to ::nsf::parameter::syntax(..) - xotcl2: adjusted manual parameter syntax entries to new conventions

  1. … 6 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.
- removed some TODOs from tests/parameters.test

- parameter dispositions:

We differentiate now between "initcmd" and "cmd": an "initcmd" is only

evaluated once, but one can provide configure values for this parameter

later. a "cmd" is executed on every evaluation, it is only possible

to pass cmds to it. The trailing argument of the configure parameters

(used e.g. for scripted object/class definitions) is now of type "cmd".

Implementation not yet complete (object cases are not correct).

  1. … 8 more files in changeset.
- C-code Generator: added "-typeName" for enumeration types that allows for disambiguation of enumerations with different argument names. Before that, the argument name determined the c-type of the enumeration. Therefore it was not possible to use argName "-type" for two different functions with a different list of enumerators.

- changed "-methodtype" to simply "-type" in

/obj/ info methods ... ?-type all|scripted|builtin|alias|forwarder|object|setter|nsfproc? ...

/obj/ info object methods ... ?-type all|scripted|builtin|alias|forwarder|object|setter|nsfproc? ...

/obj/ info lookup methods ... ?-type all|scripted|builtin|alias|forwarder|object|setter|nsfproc? ...

  1. … 13 more files in changeset.
- extended parameter extractor: new functionality ::nsf::parameter get default /parameter/ ?/varname/? ::nsf::parameter get type /parameter/ /obj/ info parameter get default /parameter/ ?/varname/? /obj/ info parameter get type /parameter/

  1. … 6 more files in changeset.
- hopefully the last changes for ?object? method|variable|property: defined * "/obj/ delete object method" * "/obj/ delete object property" * "/obj/ delete object variable"

  1. … 4 more files in changeset.
- "info method syntax" returns now "/cls/ ...." - "info object method syntax" returns now "/obj/ ...."

  1. … 2 more files in changeset.
- minor cleanup

Method and configure parameter reform, Part 3: - added

/cls/ info lookup variables -> list of handles

/obj/ info lookup object variables -> list of handles

/obj/ info variable definition|name|parameter /handle/

- nx.tcl: added forward compatible scripted implementation of "lmap"

- nsf.c: handle names for private slots in pattern provided to AddSlotObjects(),

used e.g. in "info lookup slots /pattern/"

  1. … 7 more files in changeset.
- dropped "/obj/ info slot definition /obj/" in favor of "/slotobj/ definition"

  1. … 6 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, Part 2: In order to streamline the interface further, we tried to follow the idea to use "... info /plural word/" to obtain a set of handles, and then a separate call to obtain the details. Therefore, we replaced

/cls/ info slot objects

/cls/ info slot definitions

/cls/ info slot names

/obj/ info object slot objects

/obj/ info object slot definitions

/obj/ info object slot names

/obj/ info lookup slots

by

/cls/ info slots ?-type /type/? ?-closure? ?-source all|application|baseclasses? ?/pattern/?

/obj/ info object slots ?-type /type/? ?/pattern/?

/obj/ info slot definition /obj/

/obj/ info lookup slots ?-type /type/? ?-source all|application|baseclasses? ?/pattern/?

  1. … 9 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.
- moved "/obj/ info slot definition|..." to "/obj/ info object slot definition|..." for consistency - provided "parametersyntax()" for "object mixin" and "object filter"

  1. … 4 more files in changeset.
- bumped version number to 2.0b5 - tested with NaviServer and OpenACS (new version of nx needs as well a newest NaviServer, since ns_cache implementation needs to be objectified; newest NaviServer version works as well with older nx)

  1. … 3 more files in changeset.
- renamed "package require nx::class" to "package require nx::class-method" in analogy to "nx::plain-object-method"

    • -0
    • +108
    ./class-method.tcl
  1. … 1 more file in changeset.
- added "/obj/ object variable" and "/obj/ object property"

  1. … 7 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

    • -0
    • +78
    ./plain-object-method.tcl
  1. … 40 more files in changeset.
- replace nx::configure option defaultPropertyCallProtection by defaultAccessor

  1. … 1 more file in changeset.
Adding a test and a temporary fix for the ::nsf::is issue in setCheckedInstVar

  1. … 1 more file in changeset.