Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
4
Task/Generic-swap/Tcl/generic-swap-1.tcl
Normal file
4
Task/Generic-swap/Tcl/generic-swap-1.tcl
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
proc swap {aName bName} {
|
||||
upvar 1 $aName a $bName b
|
||||
lassign [list $a $b] b a
|
||||
}
|
||||
4
Task/Generic-swap/Tcl/generic-swap-2.tcl
Normal file
4
Task/Generic-swap/Tcl/generic-swap-2.tcl
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
proc swap {aName bName} {
|
||||
upvar 1 $aName a $bName b
|
||||
foreach {b a} [list $a $b] break
|
||||
}
|
||||
4
Task/Generic-swap/Tcl/generic-swap-3.tcl
Normal file
4
Task/Generic-swap/Tcl/generic-swap-3.tcl
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
proc swap {aName bName} {
|
||||
upvar 1 $aName a $bName b
|
||||
set a $b[set b $a; list]
|
||||
}
|
||||
5
Task/Generic-swap/Tcl/generic-swap-4.tcl
Normal file
5
Task/Generic-swap/Tcl/generic-swap-4.tcl
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
set a 1
|
||||
set b 2
|
||||
puts "before\ta=$a\tb=$b"
|
||||
swap a b
|
||||
puts "after\ta=$a\tb=$b"
|
||||
5
Task/Generic-swap/Tcl/generic-swap-5.tcl
Normal file
5
Task/Generic-swap/Tcl/generic-swap-5.tcl
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
set a 1
|
||||
set b 2
|
||||
puts "before\ta=$a\tb=$b"
|
||||
set a $b[set b $a;lindex {}]
|
||||
puts "after\ta=$a\tb=$b"
|
||||
Loading…
Add table
Add a link
Reference in a new issue