File: nx-callback.tcl

package info (click to toggle)
nsf 2.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 13,208 kB
  • sloc: ansic: 32,687; tcl: 10,723; sh: 660; pascal: 176; javascript: 135; lisp: 41; makefile: 24
file content (17 lines) | stat: -rw-r--r-- 422 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package require nx
package require nx::trait
package provide nx::trait::callback 1.0

nx::Trait create nx::trait::callback {
  #
  # A small support trait to ease syntactically the reference to
  # instance variables and the registration of callbacks.
  #
  :method bindvar {name} {
    :require namespace
    return [nx::self]::$name
  }
  :method callback {name args} {
    return [list [nx::self] $name {*}$args]
  }
}