Latest Tcl recipes tagged "datastructures"http://code.activestate.com/recipes/langs/tcl/tags/datastructures/new/2003-11-20T07:58:29-08:00ActiveState Code RecipesGettok (Tcl)
2003-11-20T07:58:29-08:00Kiko The Kinghttp://code.activestate.com/recipes/users/772309/http://code.activestate.com/recipes/252145-gettok/
<p style="color: grey">
Tcl
recipe 252145
by <a href="/recipes/users/772309/">Kiko The King</a>
(<a href="/recipes/tags/datastructures/">datastructures</a>).
Revision 3.
</p>
<p>It returns the Xth token in a sentence..
like: i have a sentence divided by : and i want to get the second value
sentence:
set x "Value 1 : Value 2 : Value 3"
[gettok $x 2 :]
is returns <b>Value 2</b>
if you use 0 as the number...it will returns the number of tokens
in this case... <b>3</b></p>
Minimal unique procedure for the versionally challanged (Tcl)
2002-09-01T08:35:34-07:00Nir Levyhttp://code.activestate.com/recipes/users/511931/http://code.activestate.com/recipes/147663-minimal-unique-procedure-for-the-versionally-chall/
<p style="color: grey">
Tcl
recipe 147663
by <a href="/recipes/users/511931/">Nir Levy</a>
(<a href="/recipes/tags/datastructures/">datastructures</a>).
</p>
<p>Altough the latest Tcl verions have a -unique flag for lsort, older verions do not. So for those with older versions here is some nice, fast uinquer.
Note that it assumes that the list items do not include the charecter ',' so it should probably be used only with numeric data.</p>
OO Meta-programing: method generation from a template (Tcl)
2001-09-08T10:37:50-07:00Kristoffer Lawsonhttp://code.activestate.com/recipes/users/129886/http://code.activestate.com/recipes/68378-oo-meta-programing-method-generation-from-a-templa/
<p style="color: grey">
Tcl
recipe 68378
by <a href="/recipes/users/129886/">Kristoffer Lawson</a>
(<a href="/recipes/tags/datastructures/">datastructures</a>).
</p>
<p>A straightforward routine to allow easy creation of new methods based on
a previous template. The implementation language is XOTcl. This could also
be considered a showcase for some XOTcl features.</p>
Collection of bit manipulation functions. (Tcl)
2001-09-08T10:01:37-07:00Scott Beasleyhttp://code.activestate.com/recipes/users/129906/http://code.activestate.com/recipes/68376-collection-of-bit-manipulation-functions/
<p style="color: grey">
Tcl
recipe 68376
by <a href="/recipes/users/129906/">Scott Beasley</a>
(<a href="/recipes/tags/datastructures/">datastructures</a>).
</p>
<p>A collection of simple bit manipulation functions in pure TCL.
Functions supplied:
testbit
setbit
clearbit</p>
Shuffling a list (Tcl)
2001-06-21T16:59:34-07:00Jeff Hobbshttp://code.activestate.com/recipes/users/98167/http://code.activestate.com/recipes/65435-shuffling-a-list/
<p style="color: grey">
Tcl
recipe 65435
by <a href="/recipes/users/98167/">Jeff Hobbs</a>
(<a href="/recipes/tags/datastructures/">datastructures</a>).
</p>
<p>How to randomly shuffle a list</p>
Sending mail with attachments (Tcl)
2003-02-23T22:42:28-08:00Jeff Hobbshttp://code.activestate.com/recipes/users/98167/http://code.activestate.com/recipes/65434-sending-mail-with-attachments/
<p style="color: grey">
Tcl
recipe 65434
by <a href="/recipes/users/98167/">Jeff Hobbs</a>
(<a href="/recipes/tags/datastructures/">datastructures</a>).
Revision 2.
</p>
<p>How to send an email using the SMTP and MIME packages in tcllib (part of ActiveTcl).</p>
Parsing comma separated values (Tcl)
2001-06-21T16:53:14-07:00Jeff Hobbshttp://code.activestate.com/recipes/users/98167/http://code.activestate.com/recipes/65433-parsing-comma-separated-values/
<p style="color: grey">
Tcl
recipe 65433
by <a href="/recipes/users/98167/">Jeff Hobbs</a>
(<a href="/recipes/tags/datastructures/">datastructures</a>).
</p>
<p>How to parse lines containing comma-separated values.</p>
Dialect for sort by... then by.. (Tcl)
2001-06-21T16:49:17-07:00Jeff Hobbshttp://code.activestate.com/recipes/users/98167/http://code.activestate.com/recipes/65432-dialect-for-sort-by-then-by/
<p style="color: grey">
Tcl
recipe 65432
by <a href="/recipes/users/98167/">Jeff Hobbs</a>
(<a href="/recipes/tags/datastructures/">datastructures</a>).
</p>
<p>In a number of applications it is necessary to sort a list after
several keys, for example first after a date and then after a name.</p>