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

proc lrot _l {
   upvar 1 $_l l
   set res [lindex $l 0]
   set l [concat [lrange $l 1 end] $res]
   return $res
}

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]