Version 15 of lrepeat

Updated 2004-10-14 06:51:03 by suchenwi

lrepeat was defined in TIP 136 [L1 ] , which has been approved for incorporation into Tcl 8.5.0 .

Eventually, the doc will be here: http://www.tcl.tk/man/tcl8.5/TclCmd/lrepeat.htm

 lrepeat number element1 ?element2 element3 ...?

This command builds up a list by repeating elements. It will be a part of Tcl 8.5.0 . Note that Tcl 8.5 is available in an early developer form from ftp://ftp.tcl.tk/pub/tcl/nightly-cvs/tcl-*gz . Early access to Tk 8.5 is there as well.

An example of how it will work is

 lrepeat 3 a => a a a
 lrepeat 3 [lrepeat 3 0] => {0 0 0} {0 0 0} {0 0 0}

RS: Note the possible confusion with string repeat's syntax:

 % string repeat a 5
 aaaaa

FW: A forward-compatible version for versions before 8.5 is available in Additional list functions


Category Command