⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 215.html

📁 Tcl 语言的入门级图书
💻 HTML
字号:
<HTML><TITLE>The Browser Plugin and Safe-Tcl: Safe-Tcl</TITLE><BODY BGCOLOR="#FFF0E0" VLINK="#0FBD0F" TEXT="#101000" LINK="#0F0FDD">
<A NAME="top"><H1>Safe-Tcl</H1></A>


<P>  The <TT>-safe</TT> switch for the <TT>interp</TT> command does four important
things.

<OL>
<P> <P><LI> It causes the following commands to be hidden in the slave:

<PRE>
   cd             exec           exit           fconfigure     file
   glob           load           open           pkg_mkIndex    pwd
   socket         source
</PRE>
<P> <P><LI> It causes any interpreter created by the slave to be created as if
the <TT>-safe</TT> switch was used &#150; whether it was or not.
<P> <P><LI> It causes the <TT>expose</TT> interpreter-object action to be unavailable
in the slave.
<P> <P><LI> It causes <TT>interp issafe</TT> <CITE>NAME</CITE> to return true when
<CITE>NAME</CITE> is the name of the slave.  This permits scripts running in
the master to be able to recognize slaves that began life with the
<TT>-safe</TT> option.  Presumeably this prevents some stupidities.
</OL>

<P>  Interpreters created with the <TT>-safe</TT> switch are called
<CITE>Safe Base</CITE>.  When slaves are Safe Base, they are essentially
deaf, dumb, and blind.  But slaves need not remain Safe Base.  Scripts running
in the master can empower them.  When this is done to a slave, it is incorrect
to call it "Safe Base" any longer.  Even so, the <TT>issafe</TT> action will
report that they are "safe."  The point of <TT>issafe</TT> is clearly to enable
master scripts to avoid giving power to arbitrary slaves and not as a test to
see what is really safe.

<P>  If Tk is going to be loaded into a safe slave of a Tk master interpreter, it
must be constrained in a way similar to the version of Tk that appears in the
plugin.  As yet, there is no simple, stable way of doing this.    With
the currently experimental version 8.1 there is a <TT>safe</TT> namespace full of
procedures that look interesting.  Check it out if you have a need that
the plugin cannot satisfy.


<!-- Linkbar -->
<P><CENTER><FONT SIZE=2><NOBR>
<STRONG>From</STRONG>
<A HREF="javascript:if(confirm('http://www.mapfree.com/sbf/tcl/book/home.html  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://www.mapfree.com/sbf/tcl/book/home.html'" tppabs="http://www.mapfree.com/sbf/tcl/book/home.html">Tcl/Tk For Programmers</A><WBR>
<STRONG>Previous</STRONG>
<A HREF="21.4.html" tppabs="http://www.mapfree.com/sbf/tcl/book/select/Html/21.4.html">section</A><WBR>
<STRONG>Next</STRONG>
<A HREF="21.6.html" tppabs="http://www.mapfree.com/sbf/tcl/book/select/Html/21.6.html">section</A><WBR>
<STRONG>All</STRONG>
<A HREF="21.html" tppabs="http://www.mapfree.com/sbf/tcl/book/select/Html/21.html">sections</A><WBR>
<STRONG>Author</STRONG>
<A HREF="javascript:if(confirm('http://www.mapfree.com/mp/jaz/home.html  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://www.mapfree.com/mp/jaz/home.html'" tppabs="http://www.mapfree.com/mp/jaz/home.html">J. A. Zimmer</A><WBR>
<STRONG>Copyright</STRONG>
<A HREF="copyright.html" tppabs="http://www.mapfree.com/sbf/tcl/book/select/Html/copyright.html">Notice</A><WBR>
<P>
<I>Jun 17, 1998</I>
 </NOBR></FONT></CENTER></BODY></HTML>


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -