example-scripts

Clone Tools
  • last updated 8 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
- added sample script doc/example-scripts/tk-geo.tcl

  1. … 1 more file in changeset.
- added example scripts rosetta-sudoku.{tcl,html} and tk-ludo.{tcl,html}

    • -0
    • +1099
    ./rosetta-sudoku.html
    • -0
    • +312
    ./rosetta-sudoku.tcl
    • -0
    • +1389
    ./tk-ludo.html
  1. … 2 more files in changeset.
- updated locomotive example to use nx::callback

- add needed "cget" call

- documentation update and regeneration of html docs

  1. … 3 more files in changeset.
- updated HTML renderings of examples

    • -109
    • +52
    ./rosetta-constraint-genericity.html
  1. … 1 more file in changeset.
nx::test: - change test cases to newer interface - don't use "namespace import nx::*" in test cases when not required

  1. … 32 more files in changeset.
nx.tcl: - renamed variable option "-config" to "-configurable" to make its intention clearer

  1. … 11 more files in changeset.
Traits: - changed from traits-as-objects to traits-as-classes. This allows for higher orthogonality of traits and class definitons and allows in principle traits for object-specific methods (not fully implemented/tested) - fixed property/variable inheritance in traits.

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

  1. … 15 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. … 39 more files in changeset.
- improve wording in rosetta example

- improve wording in rosetta example

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. … 15 more files in changeset.
- use explicit return in tutorial example scripts

- improve documentation

- minor documentation updates

cosmetical documentation changes

  1. … 1 more file in changeset.
- added design study ruby-mixins.tcl to example-docs and regression test

    • -0
    • +1133
    ./ruby-mixins.html
    • -0
    • +214
    ./ruby-mixins.tcl
  1. … 2 more files in changeset.
- generic/nsfInt.h: Provided the DECR_REF_COUNT2 #define macro for __WIN32__ builds (e.g., MinGW). Thanks to Stephan Adelsberger for pointing to the issue. - Made temp file handling in a rosetta example OS-independent; thanks to Stephan Adelsberger for the initial patch

  1. … 2 more files in changeset.
- added example file for container classes

    • -0
    • +1130
    ./container.html
  1. … 1 more file in changeset.
- provide means for "autoloading" traits

  1. … 5 more files in changeset.
- added tk-spread and tk-locomotive to example scripts

    • -0
    • +946
    ./tk-locomotive.html
    • -0
    • +196
    ./tk-locomotive.tcl
  1. … 3 more files in changeset.
- traits: renamed "useTrait" into "require trait"

  1. … 2 more files in changeset.
- nx-traits: * use "info methods -closure" instead of instantiating a class at trait-insertion time * added trait as package nx::callback

- example scripts: added tk-mini and tk-horse-race

    • -0
    • +896
    ./tk-horse-race.html
    • -0
    • +153
    ./tk-horse-race.tcl
  1. … 5 more files in changeset.
- add traits package and example scripts

    • -0
    • +899
    ./traits-composite.html
    • -0
    • +99
    ./traits-composite.tcl
    • -0
    • +846
    ./traits-simple.html
  1. … 2 more files in changeset.
- add example scripts

    • -0
    • +966
    ./per-object-mixins.html
    • -0
    • +131
    ./per-object-mixins.tcl
- nsf.c * implemented NsfObjDispatchNRE and NsfObjDispatch * this fixed all issues of tcl8.6 and interp.test (xocomm still hangs in tcl 8.6)

  1. … 3 more files in changeset.
* added ./apps/utils/source-doc-beautifier.tcl * fixed the file-handle output/formatting in rosetta-serialization.tcl; using proc "!"

    • -0
    • +797
    ./rosetta-unknown-method.html
  1. … 2 more files in changeset.
- added example rosetta-unknown-method.tcl

    • -0
    • +34
    ./rosetta-unknown-method.tcl
  1. … 2 more files in changeset.