Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/tcl8.5.2/doc/rename.n @ 43

Last change on this file since 43 was 25, checked in by landauf, 16 years ago

added tcl to libs

File size: 1.5 KB
Line 
1'\"
2'\" Copyright (c) 1993 The Regents of the University of California.
3'\" Copyright (c) 1994-1997 Sun Microsystems, Inc.
4'\"
5'\" See the file "license.terms" for information on usage and redistribution
6'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
7'\"
8'\" RCS: @(#) $Id: rename.n,v 1.5 2004/10/27 14:24:37 dkf Exp $
9'\"
10.so man.macros
11.TH rename n "" Tcl "Tcl Built-In Commands"
12.BS
13'\" Note:  do not modify the .SH NAME line immediately below!
14.SH NAME
15rename \- Rename or delete a command
16.SH SYNOPSIS
17\fBrename \fIoldName newName\fR
18.BE
19
20.SH DESCRIPTION
21.PP
22Rename the command that used to be called \fIoldName\fR so that it
23is now called \fInewName\fR.
24If \fInewName\fR is an empty string then \fIoldName\fR is deleted.
25\fIoldName\fR and \fInewName\fR may include namespace qualifiers
26(names of containing namespaces).
27If a command is renamed into a different namespace,
28future invocations of it will execute in the new namespace.
29The \fBrename\fR command returns an empty string as result.
30.SH EXAMPLE
31The \fBrename\fR command can be used to wrap the standard Tcl commands
32with your own monitoring machinery.  For example, you might wish to
33count how often the \fBsource\fR command is called:
34.CS
35\fBrename\fR ::source ::theRealSource
36set sourceCount 0
37proc ::source args {
38    global sourceCount
39    puts "called source for the [incr sourceCount]'th time"
40    uplevel 1 ::theRealSource $args
41}
42.CE
43
44.SH "SEE ALSO"
45namespace(n), proc(n)
46
47.SH KEYWORDS
48command, delete, namespace, rename
Note: See TracBrowser for help on using the repository browser.