Bindings are Scheme closures

The Tk ndexfile(index-entry "bind" "tt" aux )bind command associates Scheme scripts with X events. Starting with version 3.0 those scripts must be Scheme closures2. Binding closures can have parameters. Those parameters are one char symbols (with the same conventions than the Tcl % char, see the bind help page for details). For instance, the following Tcl script $\Longrightarrow$
$\Longrightarrow$ unspecified error makeotherˆ`=̀13`


          gobblecrbind .w <ButtonPress-3> {puts "Press on widget %W at position %x %y"}
can be translated into $\Longrightarrow$
$\Longrightarrow$ unspecified error makeotherˆ`=̀13`

          gobblecr(bind .w "<ButtonPress-3>"          (lambda (|W| x y)            (format #t"Press on widget ~A at position ~A ~A\n" |W| x y)))

Note: Usage of verticals bars for the W symbol is necessary here because the Tk toolkit is case sensitive (e.g. W in bindings is the path name of the window to which the event was reported, whereas w is the width field from the event.