Index: openacs-4/packages/acs-tcl/tcl/ad-functional-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/ad-functional-procs.tcl,v diff -u -r1.10.2.4 -r1.10.2.5 --- openacs-4/packages/acs-tcl/tcl/ad-functional-procs.tcl 2 Feb 2021 03:36:06 -0000 1.10.2.4 +++ openacs-4/packages/acs-tcl/tcl/ad-functional-procs.tcl 22 Feb 2021 16:08:00 -0000 1.10.2.5 @@ -69,7 +69,7 @@ means of 'apply' per TIP 194. Tcllib provides a 'lambda' package with procs that make use of it. - @see tcllib lambda package + @see https://www.tcl-lang.org/man/tcl/TclCmd/apply.htm } { proc $args.$body $args $body return $args.$body @@ -86,9 +86,15 @@ # binding values to arguments of a function # -------------------------------------------------------------------------------- -ad_proc -public bind {f args} { +ad_proc -deprecated bind {f args} { binds args to the first k arguments of the n-ary function f and returns the resulting (n-k)-ary function + + DEPRECATED: As of tcl8.5, Tcl has native support for 'lambda' provided by + means of 'apply' per TIP 194. Tcllib provides a 'lambda' package + with procs that make use of it. + + @see https://www.tcl-lang.org/man/tcl/TclCmd/apply.htm } { set i 0 foreach arg $args { @@ -101,7 +107,15 @@ lambda [lrange $proc_args [llength $args] $num_proc_args] $code } -ad_proc -public bind2nd {f arg} "binds arg to the 2nd argument of f" { +ad_proc -deprecated bind2nd {f arg} { + binds arg to the 2nd argument of f + + DEPRECATED: As of tcl8.5, Tcl has native support for 'lambda' provided by + means of 'apply' per TIP 194. Tcllib provides a 'lambda' package + with procs that make use of it. + + @see https://www.tcl-lang.org/man/tcl/TclCmd/apply.htm +} { set code "set [lindex [info args $f] 1] {$arg}\n" append code [info body $f] set proc_args [info args $f] @@ -271,12 +285,18 @@ # % qsort {Oracle ArsDigita SAP Vignette} [lambda {s} {string length $s}] # SAP Oracle Vignette ArsDigita -ad_proc -public const {k} { +ad_proc -deprecated const {k} { Returns a unary function that ignores its argument and constantly returns k.
map [const 7] [list 1 2 3 4 5] = {7 7 7 7 7}