Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Misleading documentation for [namespace inscope]

Closed / Fixed670110ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 24 years ago
Descriptionplain2003-01-18 02:05:25
(from discussions on the Tcl'ers Chat, 16 Jan 2002)

The documentation for [namespace inscope] is
misleading, in that it claims to have "lappend
semantics" and "treats the first argument as a list". 
This is only true under the Tcl 7.X definition of
"lappend", not under the 8.X definition.
jenglishplain2003-01-18 09:08:51
Logged In: YES 
user_id=68433

Here is a proposed rewording.  Let me know if this looks OK
and I'll commit the change.

.TP
\fBnamespace inscope\fR \fInamespace\fR \fIscript\fR ?\fIarg
...\fR?
Executes a script in the context of the specified
\fInamespace\fR.
This command is not expected to be used directly by
programmers;
calls to it are generated implicitly when applications
use \fBnamespace code\fR commands to create callback scripts
that the applications then register with, e.g., Tk widgets.
The \fBnamespace inscope\fR command is much like the
\fBnamespace eval\fR
command except that the \fInamespace\fR must already exist,
and \fBnamespace inscope\fR appends additional \fIarg\fRs
as proper list elements.
.br
\fBnamespace inscope ::foo $script $x $y $z\fR
is equivalent to
\fBnamespace eval ::foo [concat $script [list $x $y $z]]\fR
thus additional arguments will not undergo a second round of
substitution,
as is the case with \fBnamespace eval\fR.

... 
Also, the documention for [namespace code] says that it
wraps the script in a [namespace code] command; this should
say [namespace inscope] instead.
dgpplain2003-01-22 00:35:50
Logged In: YES 
user_id=80530

that's an improvement.  make it so.
jenglishplain2003-01-22 03:10:30
Logged In: YES 
user_id=68433

Committed patch. (doc/namespace.n r1.9)
Log in (anonymous is fine) to add a comment.