[Tkabber-dev] r56 - trunk/plugins/now_playing

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Wed Sep 26 22:06:34 MSD 2007


Author: kostix
Date: 2007-09-26 22:06:33 +0400 (Wed, 26 Sep 2007)
New Revision: 56

Modified:
   trunk/plugins/now_playing/mpd.tcl
Log:
now_playing/mpd.tcl: added pure-Tcl [lassign].



Modified: trunk/plugins/now_playing/mpd.tcl
===================================================================
--- trunk/plugins/now_playing/mpd.tcl	2007-09-26 00:14:29 UTC (rev 55)
+++ trunk/plugins/now_playing/mpd.tcl	2007-09-26 18:06:33 UTC (rev 56)
@@ -31,6 +31,17 @@
 	proc warn {topic msg} {
 		puts $msg
 	}
+
+	# Schelte Bron's implementation of [lassign] (appeared in Tcl 8.5)
+	# from http://wiki.tclers.tk/1530
+	# Note that Tclx also has [lassign] so we check for the existence of
+	# this command instead of checking the Tcl's version.
+	if {[info procs ::lassign] == ""} {
+		proc ::lassign {values args} {
+			uplevel 1 [list foreach $args [linsert $values end {}] break]
+			lrange $values [llength $args] end
+		}
+	}
 }
 
 #### Polling:



More information about the Tkabber-dev mailing list