guile-pstk

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 5ab87a9b423cc021a3a0d7666ff91cd8ef63de77
parent 09970d06454da8b376b4ec2c60c7350ab4d09747
Author: Yuval Langer <yuval.langer@gmail.com>
Date:   Sat, 22 Jun 2024 09:43:05 +0300

Comment some Tcl initialisation code.

Diffstat:
Mtk-init.tcl | 15+++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/tk-init.tcl b/tk-init.tcl @@ -4,10 +4,21 @@ if {[package version tile] != ""} { } namespace eval AutoName { + # This closure is used to return names that are never the same. + # Names are either the argument provided to autoName and the + # counter, or the default ## and the counter. + # + # Examples: + # % # When the argument is "moo": + # % ::AutoName::autoName moo # + # moo1 + # % # When there are no provided arguments, the default "##" one is used: + # % ::AutoName::autoName + # ##2 variable c 0 - proc autoName {{result \#\#}} { + proc autoName {{providedName \#\#}} { variable c - append result [incr c] + append providedName [incr c] } namespace export * }