Posted to tcl by suchenwi at Fri Sep 02 18:42:14 GMT 2022view raw

  1. proc lrot _l {
  2. upvar 1 $_l l
  3. set res [lindex $l 0]
  4. set l [concat [lrange $l 1 end] $res]
  5. return $res
  6. }

Comments

Posted by dandyn at Fri Sep 02 18:45:52 GMT 2022 [text] [code]

set x {cat horse dog} proc lrot _l { upvar 1 $_l l set res [lindex $l 0] set l [concat [lrange $l 1 end] $res] return $res } puts [lrot x]