Compare commits

...
293 Commits
Author SHA1 Message Date
dgp e54d9d0c94 merge 8.7 2018-02-23 18:08:36 +00:00
dgp 6faf2feff2 Don't let presence of a string rep prevent optimizations on "pure" bytearrays. 2018-02-23 17:49:23 +00:00
dgp 9090aca429 Remove tests of "end-offset" Tcl_ObjType, taken private. 2018-02-23 17:17:47 +00:00
dgp fe83175465 [8e6a9ac221] Stop false matching with bytearrays. (string-11.55) 2018-02-23 17:02:08 +00:00
dgp 4ad7747c62 Cease registration of the "end-offset" Tcl_ObjType. Give it file scope.
Remove the updateStringProc that can never be called.
2018-02-23 15:44:10 +00:00
jan.nijtmans 812174d578 Correctly distinguish between internalrep.longValue (in case of boolean) and internalre.wideValue (in case of int). Add comment warning for that 2018-02-22 20:03:56 +00:00
dgp 471d356605 [89dfecb6b7] Make thread IDs in testing commands consistent. 2018-02-22 18:59:59 +00:00
dgp d92edae7e2 merge 8.7 2018-02-15 18:27:05 +00:00
jan.nijtmans 2d54b68224 Distingish between boolean and int when checking whether a boolean is true or not: The internal representation might be either long or wideInt. 2018-02-15 18:02:00 +00:00
dgp cce4368ace Revert recent commit that changed behavior of TclGetIntForIndex() for a
small subset of cases of overflow in index arithmetic.  This changed the
public behavior of indexes.

I favor what's being done. I only want to do the complete work on a 
feature branch (coming soon), and consider what aspects may benefit from
a TIP, and how we should future-proof the work against expanding ranges
for valid index values in Tcl 9. This touches on issues partially raised in 
TIP 297.
2018-02-15 17:21:46 +00:00
dgp 7a1cc7e3b3 Guarantee the buffer is large enough it will not be overrun. 2018-02-15 15:58:36 +00:00
dgp 0b90c0b92e Stop seeking out the libieee.a library and linking to it when found. 2018-02-15 15:14:56 +00:00
dgp 0af226b20a merge-mark 2018-02-15 13:52:23 +00:00
jan.nijtmans e62743b6ee Move TclGetBooleanFromObj to tclInt.h, so multiple source files can use it. Change some internal variables from int to size_t. 2018-02-14 22:22:00 +00:00
jan.nijtmans 0b96f3fb32 Merge TIP #476 2018-02-14 20:22:45 +00:00
jan.nijtmans 3971514c1b Better range checking in "string index". Add test-case to prove point. 2018-02-14 20:17:22 +00:00
dgp c64afc94f1 merge 8.7 2018-02-14 15:33:29 +00:00
dgp 3c9a74f58c merge 8.7 2018-02-14 15:00:17 +00:00
dgp 55898c44b9 Fix regression in [expr {0%$bignum}]. 2018-02-14 14:38:15 +00:00
dgp c329006b1a More tests for bignum modulus regressions 2018-02-14 12:52:35 +00:00
dgp dc74da2f56 merge-mark 2018-02-14 12:50:22 +00:00
dgp 01a9d5c7cc merge mark 2018-02-13 21:00:24 +00:00
dgp 4a6163c6a6 test expr-32.7 for bignum modulus range. FAILING for now. Error in TIP 484. 2018-02-13 20:59:36 +00:00
dgp 7cdfbbc10c merge 8.7 2018-02-09 20:57:30 +00:00
sebres 0031252bf1 small code review: resolve conversion warnings (possible loss of data, signed/unsigned comparison) 2018-02-09 10:09:42 +00:00
jan.nijtmans 4d73b33b87 Fix [9280abbaf57fca3e|9280abbaf5]: Compiling core-8-branch with msvc6 32 bit results in compile error in tclInt.h. Thanks to sebres for the fix. 2018-02-08 20:43:00 +00:00
sebres e2877119cd fixes [9280abbaf57fca3eb40a89403d9d891853209bb6]: compare of LLONG_MAX == LONG_MAX does not possible in preprocessor
(because LLONG_MAX could be complex expression), use `defined(TCL_WIDE_INT_IS_LONG)` instead of.
2018-02-08 14:41:06 +00:00
sebres 451c384456 merge core-8-6-branch 2018-02-08 14:03:59 +00:00
dgp 185cdc39c6 TIP 484: Merge 'int' and 'wideInt' Obj-type to a single 'int' 2018-02-06 20:07:13 +00:00
dgp 365ee5bb13 TIP 493: Cease Distribution of http 1.0 2018-02-06 19:55:18 +00:00
dgp f674720166 Merge the NRE-enabling of [package require]. 2018-02-06 19:43:12 +00:00
dgp a37e29cf85 Rework a set of TclString*() routines for consistency. 2018-02-06 19:35:36 +00:00
dgp fde3c52d29 Rework TclStringReverse to consistent standard form. 2018-02-06 19:10:45 +00:00
dgp 99ca63a80a TclStringLast fixed. 2018-02-06 18:33:41 +00:00
dgp 25fcbf685d Rename TclStringFind to TclStringFirst. Repair its operations on bytearrays.
Stop trying to operate on utf-8 until we nail that down better.
2018-02-06 17:26:40 +00:00
pooryorick 2567185fd2 Add remaining wrapper to the NR functions, remaining calls to
TCL_NRAddCallback, and a test for a package require script that yields.
2018-02-06 11:16:51 +00:00
dgp ca5e7c5b63 Revise the TclStringCat() interface to follow a common pattern. 2018-02-05 16:34:28 +00:00
dgp 836fa11775 Revise TclStringRepeat() interface so that in place operations are done only
by caller request. Establish a re-usable pattern.
2018-02-05 16:10:02 +00:00
dgp 3be49723fc Improved overflow prevention. 2018-02-05 13:41:26 +00:00
dgp da7f77f96f Improved overflow prevention. 2018-02-05 13:33:21 +00:00
pooryorick 98887219c2 Refine documentation for Tcl_NR* functions. 2018-02-03 18:15:06 +00:00
José Ignacio Marín 93310b9171 Update TZ info to tzdata2018c. 2018-02-02 09:21:05 +00:00
apnadkarni 73eb8eb8d1 Fix INCLUDE_INSTALL_DIR def when building against Tcl source. Bump rules.vc to 1.2 2018-02-02 06:17:05 +00:00
pooryorick 77821adfe8 Fix segmentation fault triggered by test package-3.12. Adapt signature of
PkgRequireCore to conform to Tcl_ObjCmdProc, and call it in Tcl_PkgRequireProc
on an NRE trampoline via Tcl_NRCallObjProc.  Additional callbacks still needed
to fully NRE-enable [package require].
2018-01-31 00:07:22 +00:00
dgp 4f918b61b0 merge 8.7 2018-01-29 13:18:39 +00:00
pooryorick 1a98844412 Preparation to provide TclNRPackageObjectCmd: Eliminate the loop in
PkgRequireCore so that TclNRAddCallback can be added at the needed spots.

This checkin creates a crash in test package-3.12 .

Pushing the work off the 8.7.* branch and onto a feature branch for now.
2018-01-28 18:21:09 +00:00
pooryorick 876f2d5b63 Change the signature of PkgRequireCore in preparation to provide
TclNRPackageObjCmd.
2018-01-28 14:37:53 +00:00
pooryorick fa7659336c Remove restriction on defining the class of a TclOO object not explicitly
instantiated from ::oo::class.
2018-01-27 18:17:09 +00:00
dgp 175fe8c23f Fix segfault due to shimmering in [join $l $l]. (Test join-4.1). 2018-01-27 01:45:27 +00:00
jan.nijtmans 2eba1ce11e Rename (internal) TclNewWideObj macro to TclNewIntObj. Change Tcl_SetIntObj/Tcl_SetLongObj to macro's referencing Tcl_SetWideIntObj (since all of those do the same now) 2018-01-26 13:29:01 +00:00
jan.nijtmans 6cd01fd0f8 Merge core-8-branch. Also some minor performance improvement: Turn Tcl_NewLongObj/Tcl_NewIntObj/Tcl_DBNewLongObj into macro's refering to their WideInt equivalent, since all of those do exactly the same now. 2018-01-26 12:32:12 +00:00
dgp a91a25c071 New bytecode instructions must be appended at the end of the instruction table. 2018-01-25 22:42:02 +00:00
dgp 4a6af27995 merge 8.7 2018-01-25 21:59:17 +00:00
dgp d20d1e603b test suite debugging 2018-01-25 21:35:01 +00:00
dgp 7ae57a5517 Dup test names 2018-01-25 19:50:12 +00:00
dgp 554cff1f33 merge 8.7 2018-01-25 19:36:03 +00:00
jan.nijtmans 68214211b7 Document "L" length modifier and (new) %a/%A specifiers. 2018-01-24 12:02:05 +00:00
jan.nijtmans 92aca935b3 merge core-8-6-branch 2018-01-24 10:00:34 +00:00
jan.nijtmans 8a7371192a merge core-8-branch. Improve documentation (format.n). 2018-01-24 08:47:24 +00:00
jan.nijtmans 0abda82b1e In Tcl 9.0, don't register oldBooleanType any more. And rename "booleanString" to "boolean" in tclBooleanType. Many extensions (e.g. [http://cyqlite.sourceforge.net/cgi-bin/sqlite/info/451bb2c1f8554eee|sqlite]) still test for "boolean", although that stopped working already for a long time.
In Tcl 8.7, do the same when compiled with -DTCL_NO_DEPRECATED.
2018-01-23 14:52:34 +00:00
dgp 92c0d0a011 typo 2018-01-22 13:38:47 +00:00
jan.nijtmans fb10dc69ee make the old "int" type "static", since it's just used in a single file. 2018-01-22 09:54:40 +00:00
jan.nijtmans 03a71b0706 Put old "int" type back. Not used by Tcl anymore, but this restores compatibility with Tk < 8.6.9 and some extensions: "nsf", "tdbcload", "tclxml" and "VecTcl"
(this workaround was used by "boolean" as well, when its internal implementation changed, there's still an oldBooleanType because of that)
2018-01-22 09:18:19 +00:00
jan.nijtmans a4953f93f4 merge core-8-branch 2018-01-22 08:41:16 +00:00
jan.nijtmans 1c35ed873a Follow-up to previous commit (TIP #485 implementation). Actually remove Tcl_Backslash and Tcl_EvalTokens when compiling with -DTCL_NO_DEPRECATED. 2018-01-20 16:02:31 +00:00
jan.nijtmans ac67b57981 merge core-8-branch 2018-01-18 09:46:29 +00:00
jan.nijtmans 7ea11c7f98 TIP #485 implementation, Tcl 8.6 part: If Tcl is compiled with -DTCL_NO_DEPRECATED, all Deprecated API (as in the TIP) will be gone. 2018-01-17 11:47:37 +00:00
jan.nijtmans e755aba59f merge core-8-6-branch (typo's) 2018-01-17 10:07:42 +00:00
jan.nijtmans 9a892a33b7 merge core-8-branch 2018-01-16 08:40:47 +00:00
jan.nijtmans 8e6fe27ecc merge core-8-branch 2018-01-15 11:41:56 +00:00
jan.nijtmans f0b9b9fbb6 merge core-8-branch 2018-01-12 16:30:03 +00:00
jan.nijtmans 244885a03e merge core-8-6-branch 2018-01-11 15:45:20 +00:00
jan.nijtmans 48d6a20861 Re-implement Tcl_WinTCharToUtf/Tcl_WinUtfToTChar in pure win32 api, even for TCL_UTF_MAX=3. We can do that now safely, because of the changed handling of valid 4-byte UTF-8 characters in the previous commit. 2018-01-10 14:02:03 +00:00
jan.nijtmans 498f069f0e Fix [https://core.tcl.tk/tk/info/00a27923ee26437611e1ed83f96e15b6caabcd8b|00a27923ee]: (Tcl part, remaining is in Tk) text/entry dysfunctional when pasting an emoji on MacOSX.
This changes the handling of incoming valid 4-byte UTF-8 sequences: Those are no longer split in 4 separate characters (as was done for invalid byte sequences) but replaced by a single ' replacement character' .
2018-01-10 08:25:13 +00:00
jan.nijtmans 48456596ff (partial) fix for [https://core.tcl.tk/tk/info/00a27923ee26437611e1ed83f96e15b6caabcd8b|00a27923ee]: text/entry dysfunctional when pasting an emoji on MacOSX.
Don't handle incoming valid 4-byte UTF-8 characters as invalid byte sequences (since they aren't), but as being the Unicode replacement character.
2018-01-09 11:15:14 +00:00
dkf 6d9902632c Some refactoring and tidying up of comments. 2018-01-09 00:10:22 +00:00
pooryorick fafc11d6e0 Merge pyk-TclOO branch. See [90657479e8] 2018-01-08 18:27:57 +00:00
pooryorick 4a5058fc1b Udate Tcl_ObjectDeleted to reflect recent changes. 2018-01-08 18:21:40 +00:00
pooryorick 7e4261e22c Rearrange a few lines TclRenameCommand to reduce operations. 2018-01-08 17:03:07 +00:00
jan.nijtmans eb1212a3c1 merge core-8-6-branch 2018-01-04 13:01:18 +00:00
dgp 6c799d891d Minimal fixes to stop the [package files] machinery writing to freed mem.
This contribution needs a careful review from someone who actually knows
how Tcl_Preserve, etc. work.
2018-01-04 02:32:46 +00:00
dgp 32f3dce79d merge 8.7 2018-01-03 15:11:25 +00:00
dgp daa36e9a1b Use http 2 instead of http 1 for Safe Base testing. 2017-12-29 17:47:50 +00:00
dgp b0898beca6 Remove http 1.0 tests. 2017-12-29 17:38:10 +00:00
dgp a922e9fd15 Remove http 1.0 files from fossil management. 2017-12-29 16:54:50 +00:00
dgp 6631e46bd3 Remove handling of http 1.0 package files from Makefiles. 2017-12-29 16:49:47 +00:00
jan.nijtmans 4a038240c4 merge core-8-6-branch 2017-12-28 21:15:20 +00:00
jan.nijtmans a27cc004d2 merge core-8-6-branch 2017-12-28 18:51:12 +00:00
jan.nijtmans ca634be831 merge core-8-branch 2017-12-28 16:53:34 +00:00
pooryorick b0e6ac7da9 merge core-8-branch 2017-12-26 17:27:28 +00:00
pooryorick 9a9b619c9f TclOO: Remove unneeded name manipulation from TclOOCopyObjectCmd. 2017-12-26 12:27:14 +00:00
apnadkarni 0b3bf9e30d Merged core-8-6-branch: replace ifdef TCLDIR with compare against empty string 2017-12-26 03:32:05 +00:00
jan.nijtmans cae732bd8d merge core-8-6-branch (changes file only) 2017-12-23 18:40:21 +00:00
apnadkarni 444ba0a874 Merge nmake rules 1.1 2017-12-23 08:02:20 +00:00
jan.nijtmans 189c6453b4 Change a few (internal) refCount/mask variables to unsigned type. 2017-12-22 15:45:05 +00:00
jan.nijtmans 5a190dd003 Remove use of compiler option "opt:nowin98". Don't use "t" as suffix any more when building extensions (but still use it for Tcl and Tk). 2017-12-21 13:23:38 +00:00
jan.nijtmans 5bcb4bc9a0 merge-mark 2017-12-21 07:50:27 +00:00
pooryorick 5e11793221 Further fix for issue [ba1419303b4c]: Delete a namespace for an ensemble having a
deletion trace deletes its namespace: segmentation fault.
2017-12-20 18:25:08 +00:00
pooryorick dc40e6f797 Fix for issue [ba1419303b4c]: Delete a namespace for an ensemble having a deletion
trace deletes its namespace: segmentation fault.
2017-12-20 11:28:25 +00:00
dgp b6f5c15189 [586e71dce4] Exeception handling at level #0 by EvalObjv 2017-12-19 21:00:17 +00:00
jan.nijtmans 34c238c152 merge core-8-branch 2017-12-19 15:46:25 +00:00
jan.nijtmans 07c71d17a2 Somewhat better backwards compatibility on 64-bit platforms. 2017-12-19 15:20:32 +00:00
jan.nijtmans 051a7ec3ae merge core-8-branch 2017-12-19 12:26:54 +00:00
jan.nijtmans ee66488c36 Make TclEnsureNamespace() MODULE_SCOPE. Also change some refCount fields from type "int" to "unsigned int" for increased range. 2017-12-19 11:23:13 +00:00
jan.nijtmans f64bba0499 Minor simplification on Cygwin, since we only support Windows NT now 2017-12-19 11:21:33 +00:00
jan.nijtmans dbe18af9ea No need any more to check for "Windows NT" here, since the minimum is XP now. 2017-12-18 14:33:11 +00:00
jan.nijtmans 52dc6e55e5 merge core-8-6-branch 2017-12-18 13:58:05 +00:00
jan.nijtmans 03e581e857 merge core-8-6-branch. Remove win/coffbase.txt, which isn't used any more. 2017-12-18 11:47:35 +00:00
jan.nijtmans aecff8b1e7 Revert a few more (int -> size_t) transitions, which could effect extensions (such as Itcl 3.4) which use internal Tcl header files. Better wait until 9.0 for this.
What we _can_ do is change some (internal) fields to 'unsigned': that doubles the epoch range without further danger. Thanks, Don, for pointing this out!
2017-12-15 21:27:14 +00:00
dgp 67f6f5cdb1 Revert the (int -> size_t) transition of the "cmdEpoch" field of
the struct Command that was part of [ff3f6a12a8d099ef], and related changes.

This change broke the ability of Itcl 3.4 built against Tcl 8.6 headers
to successfully [load] into and operate in a Tcl 8.7 interp.

"Command" is a private struct, and Itcl 3 should have respected that, but
it has not, and changing the size of the cmdEpoch field broke the ability
of Itcl 3 to operate on later fields of the struct, notably the deleteProc,
which it makes extensive use of.

I believe we should keep the change in the Tcl 9 sources.
2017-12-15 16:50:50 +00:00
jan.nijtmans 4fb66d5d55 Mark TclPrecTraceProc() as deprecated, and remove it when compiling with -DTCL_NO_DEPRECATED. See TIP #488 2017-12-15 14:46:11 +00:00
jan.nijtmans 556dc3036e Fix (harmless) compiler warning with Visual Studio 2017-12-14 12:02:13 +00:00
pooryorick 3ddcb1cfb5 Fix syntax error in previous commit. 2017-12-13 12:56:02 +00:00
apnadkarni 191ea171cb core-8-6-branch merge: Use nmakehlp -L to locate directories 2017-12-13 10:31:02 +00:00
apnadkarni 137a89f1e2 Add -L option to nmakehlp to locate directories 2017-12-12 17:33:21 +00:00
pooryorick 0239e7e77f Add the check for wrong arguments back to TclOO_Object_Destroy, remove
inadvertant increment of Namespace->refCount.
2017-12-11 23:50:22 +00:00
apnadkarni dddf400b7e Merge from core-8-6-branch - install stubs and headers where present 2017-12-11 16:40:30 +00:00
pooryorick 2555e0d7e6 Streamline TclOO object cleanup routines. 2017-12-10 21:45:26 +00:00
jan.nijtmans dfeacc8edb Fix [040586323610be22f8617962377324f4ddc9bc02|0405863236]: wrong field checked in struct pollfd in TclUnixWaitForFile 2017-12-10 14:35:02 +00:00
jan.nijtmans 9ef7f0a940 merge core-8-6-branch 2017-12-09 15:32:46 +00:00
apnadkarni 54ae4feac8 TIP477 merge: nmake build reform 2017-12-08 15:27:49 +00:00
jan.nijtmans a3daf1a6d1 TIP #487: Stop support for Pre-XP Windows 2017-12-07 12:14:23 +00:00
dgp 7573551ccb Plug memleak recently put into [package require]. 2017-12-06 20:48:12 +00:00
dgp 4644a04ee3 merge 8.6 2017-12-06 20:02:46 +00:00
dgp 21877b851c Adapt the bytearray accommodation of Tcl_CharLength() for 8.7+. 2017-12-06 13:28:12 +00:00
dgp d7ed325913 [ce3a211dcb] Failed file normalize when tail is empty string. 2017-12-06 13:06:47 +00:00
jan.nijtmans 3f1dfde45f Don't do same test twice 2017-12-06 12:17:33 +00:00
jan.nijtmans c15cc5c510 merge 8.7 2017-12-06 12:10:35 +00:00
jan.nijtmans 99e890b52c merge core-8-branch 2017-12-06 12:00:24 +00:00
dgp 72f0f0b346 [4f6a1ebd64] Stop crash when same value passed to the -map and -subcommands options of ensemble configuration. 2017-12-05 15:52:55 +00:00
jan.nijtmans f0d821a83c merge core-8-6-branch 2017-12-01 12:48:26 +00:00
jan.nijtmans 1a237e67df Simpler solution for Itcl 3.4 build (compatibilty) problem. Thanks to Don Porter for bringing this to my attention! 2017-12-01 10:38:04 +00:00
dgp db726dc570 [5808081213] Permit all bytearrays (including impure ones) to report length without shimmering 2017-11-30 17:21:12 +00:00
jan.nijtmans 88233497ab merge core-8-branch 2017-11-30 16:18:54 +00:00
jan.nijtmans b96b6a46ba merge core-8-branch 2017-11-30 16:08:03 +00:00
jan.nijtmans 0efada5548 Eliminate use of certain unnecessary struct names. Also white-spacing. Nothing functional. 2017-11-30 16:03:01 +00:00
jan.nijtmans 99798b2202 Fix build of test-suite, after previous commit 2017-11-30 15:24:39 +00:00
jan.nijtmans f327b7e9dc merge core-8-6-branch.
Provide compatibility macro's, compensating for the internal stub table change, so Itcl 3.4 builds again. Thanks to Don Porter for bringing this to my attention!
2017-11-30 14:36:16 +00:00
jan.nijtmans 72998869a3 Fix [8e1e31eac0fd6b6c4452bc108a98ab08c6b64588|8e1e31eac0]: lsort treats NUL chars strangely. Also fix various initializations, which only make a difference when TCL_UTF_MAX == 4.
Add new test-cases which demonstrate the fix. For TCL_UTF_MAX == 4, surrogates will now be handled as expected as well when sorting.
2017-11-30 13:14:43 +00:00
pooryorick c47ba70f45 Add TCL_CREATE_NS_IF_UNKNOWN back into Tcl_CreateEnsemble(). 2017-11-29 18:35:51 +00:00
jan.nijtmans 4190501ec7 merge core-8-6-branch 2017-11-29 12:28:21 +00:00
pooryorick c032f5043e Fix for [6bca38d59b], TclOO segmentation fault cleaning up objects that that
have mixed themselves into themselves.
2017-11-29 12:01:21 +00:00
jan.nijtmans 79b5a0a716 merge core-8-6-branch 2017-11-29 11:05:15 +00:00
pooryorick 8396e878da Fix for issue [6cf568a21b]: Tcl_Eval() causes new segfault (TclOO object
creation by qualified name).
2017-11-28 23:33:14 +00:00
pooryorick fe65a79d19 Minor refactoring of TclOO object reference count booking during object
creation.
2017-11-28 15:43:41 +00:00
pooryorick a8a602d3ff Eliminate some duplicate code in tclOO.c/Tcl_NewObjectInstance(). 2017-11-27 23:30:57 +00:00
pooryorick 2930169517 Streamline TclOO object cleanup routines. 2017-11-27 19:45:40 +00:00
jan.nijtmans d95ab0247a missed some more failing test-cases 2017-11-27 14:11:16 +00:00
jan.nijtmans 20dedcd841 Fix test-cases in safe.test, failing due to changes in min/max math functions. 2017-11-27 13:52:18 +00:00
pooryorick 811ec68434 Add missing parenthesis to an expression in TclEnsureNamespace. 2017-11-25 18:24:10 +00:00
pooryorick c2e98a86d4 merge pyk-command-named-colon 2017-11-25 16:53:59 +00:00
pooryorick 48fb6e2c88 Fix for issue [4f6a1ebd64]: ensemble: segmentation fault when -subcommand and
-map values are the same object.
2017-11-25 16:36:22 +00:00
jan.nijtmans ca83d59e10 merge core-8-branch.
now really remove the math-related functions when compiling with -DTCL_NO_DEPRECATED. Also no longer supply Tcl_Value, Tcl_ValueType and TCL_RESULT_SPACE.
2017-11-23 13:56:21 +00:00
jan.nijtmans 160a58238a If compiled with -DTCL_NO_DEPRECATED, remove stub entry for TclWinGetPlatformId() 2017-11-23 12:21:35 +00:00
jan.nijtmans dd0e9cf6b1 Remove more pre-XP stuff. 2017-11-23 12:04:33 +00:00
jan.nijtmans 3c23d21835 Re-base "stop-ce" branch to core-8-branch. This is what will be proposed for 8.7 in TIP #487. 2017-11-23 08:30:10 +00:00
pspjuth fac696b394 merge pspjuth-cminmax 2017-11-21 22:46:35 +00:00
jan.nijtmans 9215c2610c Drop Windows CE support, since it doesn't appear to work anyway. 2017-11-21 14:59:04 +00:00
jan.nijtmans 119652bd95 deprecate VOID/CHAR/SHORT/LONG (windows-only) as well. 2017-11-21 09:48:36 +00:00
jan.nijtmans 011dd7b0f6 Revert [d874801c57]: putting back "string bytelength". It turns out to be too complicated to take along with the other deprecations in TIP #485 2017-11-21 09:13:08 +00:00
jan.nijtmans 52b098ca11 Deprecate support for macro's like CONST, CONST84, _ANSI_ARGS_, INLINE, TCL_VARARGS 2017-11-20 16:26:03 +00:00
jan.nijtmans 82877a8aa3 merge core-8-branch. Deprecate support for "string bytelength" 2017-11-20 16:01:05 +00:00
jan.nijtmans a1bc5b8a2b If Tcl is compiled with -DTCL_NO_DEPRECATED, remove a lot of (internal) stub entries which correspond to functions which will be removed in Tcl 9.
This commit should have been part of [7849f573c0e7d758|this] earlier commit. 
No effect when Tcl is not compiled with -DTCL_NO_DEPRECATED.
2017-11-20 12:07:08 +00:00
jan.nijtmans c19490026d Re-base to core-8-branch: This change is fine as-is for Tcl 8.7, I wouldn't recommend it for 8.6 (even though it's only for the changed error-message) 2017-11-20 10:30:02 +00:00
jan.nijtmans bc3e198cba Fix error-message for min/math functions: "to" -> "for", for consistancy with the error-messages for other math functions. 2017-11-20 10:15:59 +00:00
jan.nijtmans b946ce971f Fix [e058307eef73cf21cf6805ad7c778e1024f9eb7d|e058307eef]: Use of values.h breaks build of Tk trunk on macOS 2017-11-20 08:58:39 +00:00
pspjuth c2eeda3f09 Changed math functions min and max to C implementations. 2017-11-19 18:40:13 +00:00
jan.nijtmans 4eed307023 merge core-8-branch. Also fix some test-cases, expecting the existence of "int" objType. 2017-11-15 15:00:25 +00:00
jan.nijtmans 0dd94666f5 Merge dgp's "end-int-registration" branch, but slightly different: In stead of not registering "int", continue to register it as being "wideInt" for Tcl 8.x. This should assure maximum compatibility with Tcl 8.6-based extensions.
In addition, revert some boolean-related changes (keep the longValue usage here in stead of wideValue). And stop registering oldBoolean starting with Tcl 9.
2017-11-15 14:13:09 +00:00
dgp 1ed5a135ed TIP 484 proposes a re-implementation of Tcl's "int" Tcl_ObjType.
Since the new implementation is not consistent with the former one, any
callers of Tcl_GetObjType("int") who are expecting the return value to
point them at something playing by the former rules are at risk of having
their code broken.  In this branch I remove the registation of Tcl's
"int" type, so such callers will get NULL (which they should already be
able to handle) instead of something misleading them into breakage.

Examine this branch and decide if it should be incorporated into TIP 484.
2017-11-14 18:35:22 +00:00
dgp f6a35fe784 merge 8.7 2017-11-14 18:19:05 +00:00
jan.nijtmans b7e5592df1 Merge core-8-branch. Backout the Tcl_EvalFile changes. 2017-11-09 15:56:04 +00:00
jan.nijtmans 944a3d95ff Rebase back to 8.7 (core-8-branch), since that's what the TIP is meant for. (I see no reason to wait for 9.0) 2017-11-09 14:59:36 +00:00
dgp 29dda71bad merge trunk 2017-11-09 14:44:57 +00:00
jan.nijtmans 0faadee83c merge core-8-branch 2017-11-09 12:51:26 +00:00
jan.nijtmans a037934e21 Get rid of Tcl_DStringTrunc et al, as described in the TIP (Thanks, Don!). 2017-11-09 11:49:10 +00:00
jan.nijtmans 56e7df256a No longer mark Tcl_EvalFile() as obsolete/deprecated. Thanks to all feedback to TIP #485! 2017-11-09 11:04:49 +00:00
jan.nijtmans 429acda3ee Put Tcl_EvalFile back, but then as a macro in terms of Tcl_FSEvalFileEx(). 2017-11-09 10:34:10 +00:00
jan.nijtmans cf4d5a8cfe TIP #485 implementation: "Remove Deprecated API". Based on Tcl 8.7 (core-8-branch). 2017-11-08 11:50:55 +00:00
jan.nijtmans ed20823380 merge core-8-branch 2017-11-08 09:38:15 +00:00
dgp e82d7fb753 compiler warning 2017-11-08 03:02:22 +00:00
dgp 3b989eefe0 merge 8.7 2017-11-08 02:48:47 +00:00
pooryorick a982dd11fa Modify TclCreateProc to handle arbitrary argument names, not just ASCII. 2017-11-08 00:39:17 +00:00
pooryorick 2c1224dce7 TclOO object allocation: Set classPtr to NULL if it wasn't otherwise set. 2017-11-07 20:54:02 +00:00
jan.nijtmans a7ba08158b merge 8.7 2017-11-07 16:31:17 +00:00
jan.nijtmans 42764c99be More code simplifications, with still equal functionality. 2017-11-07 16:16:52 +00:00
dgp f941597e43 merge 8.7 2017-11-07 14:28:03 +00:00
jan.nijtmans c1e89d73fd merge core-8-branch 2017-11-07 13:30:08 +00:00
jan.nijtmans 47b333303e merge-mark 2017-11-06 15:04:23 +00:00
jan.nijtmans 27e8f4db3d More tcl8 -> tcl9 renumbering, for example related to the installation of Tcl packages where tcl9 actually can find them. 2017-11-06 14:50:08 +00:00
pooryorick 9b30058284 Rewrite documentation in comments for brevity and clarity. 2017-11-06 01:33:57 +00:00
jan.nijtmans cf516b0eb8 merge core-8-branch 2017-11-05 14:35:43 +00:00
jan.nijtmans 8c4d8a4f14 Merge core-8-branch. More 8.7 -> 9.0 changes as appropriate 2017-11-05 14:21:21 +00:00
dkf d52223f024 [0d902eadd6] Ensure that [string first] handles ASCII in Unicode correctly. 2017-11-04 00:45:27 +00:00
dgp 88451d16ba TIPs 330 & 336 changes to Tcl 9 Implementation 2017-11-03 18:56:33 +00:00
dgp 3691ae66b6 TIP 278 Implementation 2017-11-03 18:44:39 +00:00
dgp 203cbf2ea0 TIP 114 Implementation 2017-11-03 18:39:47 +00:00
dgp b6c2770a30 Merge package tolerances of Tcl 9. 2017-11-03 17:12:47 +00:00
dgp 1a0c2e24eb Bump to 9.0a0 2017-11-03 17:11:13 +00:00
jan.nijtmans 735d38cd7c merge trunk 2017-11-03 12:24:06 +00:00
jan.nijtmans 9e2ed8b729 Finally, get rid of tclWideIntType completely 2017-11-01 12:35:40 +00:00
jan.nijtmans adc216698f Eliminate most usage of TCL_NUMBER_LONG, just use TCL_NUMBER_WIDE in stead (since both have the same internal representation now) 2017-10-31 16:40:57 +00:00
jan.nijtmans 1cbd95eeee eliminate most use of (long) type, except for increments 2017-10-31 16:16:46 +00:00
jan.nijtmans db930a501f Only use 64-bit tables for all platforms 2017-10-31 14:48:28 +00:00
jan.nijtmans 2f2459e120 more progress 2017-10-31 14:40:33 +00:00
jan.nijtmans 8fd76cb873 more simplifications 2017-10-31 12:39:16 +00:00
jan.nijtmans c8fbbd8f3e Fix 2 failing test-cases, broken by some earlier commit 2017-10-31 11:37:29 +00:00
jan.nijtmans b0a9f6c55b Simplify implementation of Tcl_SaveResult/Tcl_RestoreResult/Tcl_DiscardResult by no longer assuming that Tcl_SavedResult is a struct. Backported from "novem" branch. 2017-10-31 09:48:57 +00:00
jan.nijtmans b8b341fea6 Fix some pointer arthemeric (only visible on big-endian systems) 2017-10-30 16:46:49 +00:00
dgp 9a322ef016 tidy? 2017-10-30 15:35:58 +00:00
dgp 312263821f tidy 2017-10-30 15:25:36 +00:00
dgp 9e80ee005e tidying 2017-10-30 15:15:06 +00:00
dgp 3aa68b1a0b Patch to make changes to Tcl 9 prescribed by TIPs 330 and 336.
This makes the Tcl_Interp struct fully opaque.
No interp->result or interp->errorline
2017-10-30 14:56:57 +00:00
jan.nijtmans ca470c3d4e more progress in code simplifications 2017-10-30 14:32:52 +00:00
dgp 6642181b9d Rebase tip-278 branch to workaround CVS conversion woes. 2017-10-30 12:41:21 +00:00
dgp a67fec7324 merge trunk 2017-10-30 12:02:28 +00:00
jan.nijtmans aad24c7ffc Change (internal) TclFormatInt() signature, so it can handle WideInt's directly. Ongoing simplifications ... 2017-10-30 11:01:28 +00:00
jan.nijtmans fe508fa3b5 Experimental branch meant to eliminate the "wideint" type, just merge it to a single "int" type. No effect on linux64 and similar systems, code simplification for Win64 and 32-bit system. No TIP yet, implementation ongoing. 2017-10-30 08:47:33 +00:00
dgp fcc5b3486f merge trunk 2017-10-27 13:07:10 +00:00
jan.nijtmans 16976013d1 merge trunk 2017-10-24 13:59:40 +00:00
dgp 172896b15a Implementation branch for TIP 114 - Eliminate Octal Parsing... 2017-10-23 16:20:18 +00:00
jan.nijtmans ef82c5073a merge trunk 2017-10-16 12:05:17 +00:00
jan.nijtmans 237b4d22a2 Add support for 'L' length modifier (either long double or mp_int) and 'a'/'A' modifiers (floating point in hex notation) 2017-10-16 11:55:57 +00:00
jan.nijtmans a72fed191e fix unixFCmd test-cases, as result of the octal behavior change 2017-10-14 22:52:26 +00:00
jan.nijtmans 5015dd8a1f Fix missing line (after manual merge-conflict). Fix compiler warning on linux64. 2017-10-13 14:46:26 +00:00
jan.nijtmans 5abbd5b2da Merge trunk. And merge jn-0d-radix-prefix branch in too (too small to be considered separately) 2017-10-13 14:07:47 +00:00
andy 7738955f9a Simplify noComp for loops per mailing list suggestion from sebres [https://sourceforge.net/p/tcl/mailman/message/36065252/] 2017-10-06 00:01:21 +00:00
andy a5593081ca Merge trunk 2017-10-05 23:58:27 +00:00
andy 0fd41958c6 Simplify implementation of non-bytecoded [string replace] 2017-09-23 16:36:49 +00:00
andy b9d515abdb Update TIP number 2017-09-22 22:46:25 +00:00
dgp adead74139 [3ae1251264] Run only the tests that match the assumptions of the test design. 2017-09-21 14:35:53 +00:00
andy 09faa1aab9 Include $noComp flag in string test names 2017-09-20 17:25:39 +00:00
andy 2f50095de1 Alternate, equivalent way of running bytecoded tests 2017-09-20 05:11:37 +00:00
andy 38f00ec3c8 Correct string tests to exercise both bytecoded and non-bytecoded implementations. string-29.6 now fails. 2017-09-20 05:08:10 +00:00
andy 28b052a00d Improve documentation of [string insert] with respect to end-relative indexing 2017-09-19 06:21:42 +00:00
jan.nijtmans 943b46881e Merge trunk 2017-09-18 15:13:40 +00:00
dgp 94dd110564 merge trunk 2017-09-18 13:19:00 +00:00
andy 191ef4be11 Document [string insert] 2017-09-18 03:11:05 +00:00
andy 5945daaae4 Document Tcl_ReplaceObj() 2017-09-18 03:02:12 +00:00
andy 1befabd977 Rename Tcl_StringReplace() to Tcl_ReplaceObj() for consistency with other public string object functions, most notably Tcl_ConcatObj() 2017-09-18 01:38:31 +00:00
andy e497f07f20 Improve comments 2017-09-18 01:29:58 +00:00
andy 8333560e5c Juggle [string insert] bytecode compilation logic 2017-09-18 01:19:12 +00:00
andy 6aceb254f3 Rearrange bytecoded [string replace] logic, reinstate [string replace]/[string insert] result tracing 2017-09-18 01:16:03 +00:00
andy 70ee4f5087 Use Tcl_StringReplace() to implement core of bytecoded [string replace] 2017-09-18 01:11:08 +00:00
andy 11ca91d9e4 Update stringComp.test for new [string insert] command 2017-09-18 00:48:46 +00:00
andy 0d02f56968 stringComp.test and maybe many other tests may need to be reconsidered so that both bytecoded and non-bytecoded code paths are exercised 2017-09-18 00:39:56 +00:00
andy d3499984e0 Correct terminology 2017-09-18 00:32:21 +00:00
andy cdd6d9c901 Implement bytecoded [string insert] 2017-09-18 00:32:06 +00:00
andy 98eac1c578 Correct bytecode index comments 2017-09-17 21:09:54 +00:00
andy fbbfbdeff8 Improve comment to describe return value 2017-09-17 21:09:11 +00:00
andy 94e0ec332e Merge trunk 2017-09-16 19:50:12 +00:00
jan.nijtmans 757012c289 Rebase to trunk 2017-09-08 12:48:35 +00:00
andy bb3b280cf3 Merge trunk 2017-08-30 15:22:10 +00:00
andy 535909bc9f Rename TclStringReplace() to Tcl_StringReplace() and add to the stubs table. Documentation not yet started. 2017-08-30 15:20:17 +00:00
andy 4423757d23 Add test cleanup 2017-08-20 20:11:43 +00:00
andy 1e913ed0ab Add tests to exercise almost every line of TclStringReplace(). The one line not being exercised is the "return NULL" on TclStringCatObjv() failure. Coverage checked in an ad-hoc way by putting a breakpoint at the start of every basic block, then confirming each breakpoint is hit at least once when running string.test. 2017-08-20 19:57:43 +00:00
andy f9d45ca66e Tweak string index boundary conditionals for tiny performance improvement and to make existing tests cover more code paths 2017-08-20 19:55:28 +00:00
andy 935e4615a9 Add non-bytecoded [string replace] tests to exercise new TclStringReplace() function 2017-08-20 18:13:33 +00:00
andy c8c14244d4 Add string-14.18 to test that [string replace] with last<first does not insert a string, even though we might wish that it did, to be in compliance with the documented behavior. Correct non-bytecoded [string replace] accordingly. 2017-08-20 03:45:19 +00:00
andy 31dec40c9b Reimplement NON-BYTECODED [string replace] in terms of new TclStringReplace() function 2017-08-20 03:21:27 +00:00
andy 4fcd0cb3c2 Correct NULL dereference, and optimize short-circuit logical operation 2017-08-20 03:20:45 +00:00
andy c1f053321e Work toward dgp's suggestion that the underlying engine handle both [string insert] and [string replace]. Ref: [https://sourceforge.net/p/tcl/mailman/message/36002472/] 2017-08-20 02:44:56 +00:00
andy 657e43aaa9 Correct bug in getting second Unicode character sequence 2017-08-17 18:32:12 +00:00
andy 166fce6267 Clip (don't reject) out-of-bounds indexes, per sebres's suggestion and to match [linsert] 2017-08-17 18:15:32 +00:00
andy 9614235c9d Work around [3397978fff] 2017-08-17 18:14:24 +00:00
andy 499a6f4da8 Backout [b163c4f423]: Command ensembles indeed do affect argument reference counts, see [3397978fff] 2017-08-17 17:29:19 +00:00
andy 72490b5f39 Test code to investigate command ensemble argument reference counts 2017-08-16 15:14:36 +00:00
andy 651a35fc69 Fix typo 2017-08-16 15:14:09 +00:00
andy 576adc0559 Write some test cases 2017-08-15 08:25:52 +00:00
andy 602dbc490d Correct bug in shared pure byte array case 2017-08-15 08:23:40 +00:00
andy ad835ed885 Remove repeated code 2017-08-15 08:04:36 +00:00
andy af2cc1bccb Update existing tests to accommodate new [string insert] command 2017-08-15 08:04:19 +00:00
andy c6308250b1 Begin implementation of [string insert] 2017-08-15 07:50:27 +00:00
jan.nijtmans ca0b2a012e merge trunk 2017-06-29 13:18:33 +00:00
jan.nijtmans 4401a58b2a Implement %a and %A for floating point numbers 2017-06-28 11:02:19 +00:00
jan.nijtmans ccabb2af0c Merge trunk. Don't use expensive ToUpper() for hex 0X???? formatting, just generate uppercase directly. 2017-06-27 12:00:45 +00:00
jan.nijtmans 875f1b248d Implement "format %o" as prefixing with "0o" in stead of "0" (Kevin Kenny's suggestion). Seems ready to be TIPed (just some more testing) 2017-06-27 10:13:34 +00:00
jan.nijtmans b1c5e807ca Rebase branch "jn-0d-radix-prefix" back to trunk. No new changes 2017-06-26 10:20:32 +00:00
jan.nijtmans cf30ba443c Little variation on Brian's proposal: Only prefix decimal number with '0d' when that's necessary for correct interpretation of the number when parsed back again. 2017-06-14 10:04:05 +00:00
jan.nijtmans 8c62a9c228 merge trunk 2017-06-12 13:29:40 +00:00
jan.nijtmans 3bde30215b merge-mark 2017-04-18 06:15:48 +00:00
jan.nijtmans 46db6e4a00 merge trunk 2017-04-14 10:04:33 +00:00
jan.nijtmans cddb5b612f merge trunk. New TIP is getting shape. 2017-04-12 13:49:33 +00:00
jan.nijtmans d56986e037 merge trunk 2017-04-12 10:06:32 +00:00
jan.nijtmans e9b2f70238 merge trunk 2017-04-07 15:15:42 +00:00
jan.nijtmans de59a00a30 Use "0o" in stead of "0" as octal prefix in more places. 2017-04-07 14:48:49 +00:00
jan.nijtmans 7eea851880 Merge trunk. Only use hash prefix (0x, 0b, 0 ) if value is not 0, except for %p. 2017-04-07 13:46:19 +00:00
jan.nijtmans 0515becf7a Fix fall-back test for TCL_WIDE_INT_IS_LONG, making it do the same as "configure": Should be 1 if sizeof(long long) == sizeof(long), 0 otherwise. 2017-03-31 11:05:28 +00:00
jan.nijtmans 6b2a58ffcd Merge trunk 2017-03-31 09:54:42 +00:00
jan.nijtmans 30cebba4d6 merge trunk 2017-03-29 14:57:15 +00:00
jan.nijtmans afc0ba5cdc merge trunk 2017-03-29 13:23:11 +00:00
jan.nijtmans cf3f133df1 (more experimenting): Make TCL_LL_MODIFIER behave more close to intuitive expectations: If the platform has a "long long" type, use it for Tcl_WideInt, so TCL_LL_MODIFIER is really a replacement for "ll" on most platforms (Win32/Win64 as most notable exception).
Will need a new TIP.
2017-03-29 12:05:59 +00:00
jan.nijtmans eb03584c16 (experimental) new internal macro TCL_Z_MODIFIER, just like TCL_LL_MODIFIER but then for size_t. 2017-03-28 07:14:47 +00:00
593 changed files with 49063 additions and 46302 deletions
+1
View File
@@ -44,5 +44,6 @@ unix/pkgs/*
win/Debug*
win/Release*
win/pkgs/*
win/coffbase.txt
win/tcl.hpj
win/nmhlp-out.txt
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>tcl8.6</name>
<name>tcl8</name>
<comment></comment>
<projects>
</projects>
+4 -4
View File
@@ -1,5 +1,5 @@
README: Tcl
This is the Tcl 8.6.8 source distribution.
This is the Tcl 8.7a2 source distribution.
http://sourceforge.net/projects/tcl/files/Tcl/
You can get any source release of Tcl from the URL above.
@@ -49,7 +49,7 @@ and selling it either in whole or in part. See the file
Extensive documentation is available at our website.
The home page for this release, including new features, is
http://www.tcl.tk/software/tcltk/8.6.html
http://www.tcl.tk/software/tcltk/8.7.html
Detailed release notes can be found at the file distributions page
by clicking on the relevant version.
@@ -61,9 +61,9 @@ Information about Tcl itself can be found at
There have been many Tcl books on the market. Many are mentioned in the Wiki:
http://wiki.tcl.tk/_/ref?N=25206
To view the complete set of reference manual entries for Tcl 8.6 online,
To view the complete set of reference manual entries for Tcl 8.7 online,
visit the URL:
http://www.tcl.tk/man/tcl8.6/
http://www.tcl.tk/man/tcl8.7/
2a. Unix Documentation
----------------------
+49
View File
@@ -8830,3 +8830,52 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich)
2017-12-19 (bug)[586e71] EvalObjv exception handling at level #0 (sebres,porter)
--- Released 8.6.8, December 22, 2017 --- http://core.tcl.tk/tcl/ for details
Changes to 8.7a1 include all changes to the 8.6 line through 8.6.7,
plus the following, which focuses on the high-level feature changes
in this changeset (new minor version) rather than bug fixes:
2016-03-17 (bug)[0b8c38] socket accept callbacks always in global ns (porter)
*** POTENTIAL INCOMPATIBILITY ***
2016-07-01 Hack accommodations for legacy Itcl 3 disabled (porter)
2016-07-12 Make TCL_HASH_TYPE build-time configurable (nijtmans)
2016-07-19 (bug)[0363f0] Partial array search ID reform (porter)
2016-07-19 (feature removed) Tcl_ObjType "array search" unregistered (porter)
*** POTENTIAL INCOMPATIBILITY for Tcl_GetObjType("array search") ***
2016-10-04 Server socket on port 0 chooses port supporting IPv4 * IPv6 (max)
2016-11-25 [array named -regexp] supports backrefs (goth)
2017-01-04 (TIP 456) New routine Tcl_OpenTcpServerEx() (limeboy)
2017-01-04 (TIP 459) New subcommand [package files] (nijtmans)
2017-01-16 threaded allocator initialization repair (vasiljevic,nijtmans)
2017-01-30 Add to Win shell builtins: assoc ftype move (ashok)
2017-03-31 TCL_MEM_DEBUG facilities better support 64-bit memory (nijtmans)
2017-04-13 \u escaped content in msg files converted to true utf-8 (nijtmans)
2017-05-18 (TIP 458) New epoll or kqueue notifiers are default (alborboz)
2017-05-31 Purge build support for SunOS-4.* (stu)
2017-06-22 (TIP 463) New option [regsub ... -command ...] (fellows)
2017-06-22 (TIP 470) Tcl_GetDefineContextObject();[oo::define [self]] (fellows)
=> TclOO 1.2.0
2017-06-23 (TIP 472) Support 0d as prefix of decimal numbers (iyer,griffin)
2017-08-31 (bug)[2a9465] http state 100 continue handling broken (oehlmann)
2017-09-02 (bug)[0e4d88] replace command, delete trace kills namespace (porter)
--- Released 8.7a1, September 8, 2017 --- http://core.tcl.tk/tcl/ for details
-14
View File
@@ -1,14 +0,0 @@
/*
* float.h --
*
* This is a dummy header file to #include in Tcl when there
* is no float.h in /usr/include. Right now this file is empty:
* Tcl contains #ifdefs to deal with the lack of definitions;
* all it needs is for the #include statement to work.
*
* Copyright (c) 1993 The Regents of the University of California.
* Copyright (c) 1994 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
+1 -1
View File
@@ -106,5 +106,5 @@ closedir(
close(dirp->dd_fd);
dirp->dd_fd = -1;
dirp->dd_loc = 0;
ckfree((char *) dirp);
ckfree(dirp);
}
+1 -1
View File
@@ -100,7 +100,7 @@ waitpid(
} else {
prevPtr->nextPtr = waitPtr->nextPtr;
}
ckfree((char *) waitPtr);
ckfree(waitPtr);
return result;
}
+1 -1
View File
@@ -119,7 +119,7 @@ retrieve the stack trace when script evaluation returns
\fBTCL_ERROR\fR, like so:
.PP
.CS
int code = Tcl_Eval(interp, script);
int code = Tcl_EvalEx(interp, script, -1, 0);
if (code == TCL_ERROR) {
Tcl_Obj *options = \fBTcl_GetReturnOptions\fR(interp, code);
Tcl_Obj *key = Tcl_NewStringObj("-errorinfo", -1);
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_CallWhenDeleted 3 7.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_CommandComplete 3 "" Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_Concat 3 7.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_CreateFileHandler 3 8.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_CreateInterp 3 7.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_CreateTimerHandler 3 7.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_DetachPids 3 "" Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_DictObj 3 8.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_DoWhenIdle 3 7.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_PutEnv 3 "7.5" Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_ExprLongObj 3 8.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_FindExecutable 3 8.1 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_GetCwd 3 8.1 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_GetIndexFromObj 3 8.1 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+5 -2
View File
@@ -57,6 +57,9 @@ after the optional white space and sign are
.QW \fB0x\fR
then \fIsrc\fR is expected to be in hexadecimal form; otherwise,
if the first such characters are
.QW \fB0d\fR
then \fIsrc\fR is expected to be in decimal form; otherwise,
if the first such characters are
.QW \fB0o\fR
then \fIsrc\fR is expected to be in octal form; otherwise,
if the first such characters are
@@ -65,8 +68,8 @@ then \fIsrc\fR is expected to be in binary form; otherwise,
if the first such character is
.QW \fB0\fR
then \fIsrc\fR
is expected to be in octal form; otherwise, \fIsrc\fR is
expected to be in decimal form.
is expected to be in octal form; otherwise, \fIsrc\fR
is expected to be in decimal form.
.PP
\fBTcl_GetDouble\fR expects \fIsrc\fR to consist of a floating-point
number, which is: white space; a sign; a sequence of digits; a
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_GetOpenFile 3 8.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_GetTime 3 8.4 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -281,7 +281,7 @@ The \fIhashKeyProc\fR member contains the address of a function called to
calculate a hash value for the key.
.PP
.CS
typedef unsigned int \fBTcl_HashKeyProc\fR(
typedef TCL_HASH_TYPE \fBTcl_HashKeyProc\fR(
Tcl_HashTable *\fItablePtr\fR,
void *\fIkeyPtr\fR);
.CE
+1 -1
View File
@@ -1,7 +1,7 @@
'\"
'\" Copyright (c) 1998-2000 by Scriptics Corporation.
'\" All rights reserved.
'\"
'\"
.TH Tcl_Init 3 8.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+4 -4
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_InitStubs 3 8.1 Tcl "Tcl Library Procedures"
.so man.macros
.BS
@@ -23,11 +23,11 @@ Tcl interpreter handle.
A version string consisting of one or more decimal numbers
separated by dots.
.AP int exact in
Non-zero means that only the particular version specified by
1 means that only the particular version specified by
\fIversion\fR is acceptable.
Zero means that versions newer than \fIversion\fR are also
0 means that versions newer than \fIversion\fR are also
acceptable as long as they have the same major version number
as \fIversion\fR.
as \fIversion\fR. Other bits have no effect.
.BE
.SH INTRODUCTION
.PP
+1 -1
View File
@@ -97,7 +97,7 @@ are provided by the C language standard. The \fBTcl_WideInt\fR type is a
typedef defined to be whatever signed integral type covers at least the
64-bit integer range (-9223372036854775808 to 9223372036854775807). Depending
on the platform and the C compiler, the actual type might be
\fBlong int\fR, \fBlong long int\fR, \fB__int64\fR, or something else.
\fBlong long int\fR, \fB__int64\fR, or something else.
The \fBmp_int\fR type is a multiple-precision integer type defined
by the LibTomMath multiple-precision integer library.
.PP
+1 -1
View File
@@ -101,7 +101,7 @@ the command. The \fIfreeProc\fR field will be initialized to zero,
and \fIinterp->result\fR will point to an empty string. Commands that
do not return any value can simply leave the fields alone.
Furthermore, the empty string pointed to by \fIresult\fR is actually
part of an array of \fBTCL_RESULT_SIZE\fR characters (approximately 200).
part of an array of approximately 200 characters.
If a command wishes to return a short string, it can simply copy
it to the area pointed to by \fIinterp->result\fR. Or, it can use
the sprintf procedure to generate a short result string at the location
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_LimitCheck 3 8.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Load 3 8.6 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+2 -2
View File
@@ -3,10 +3,10 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
'\" Note that some of these functions do not seem to belong, but they
'\" were all introduced with the same TIP (#139)
'\"
'\"
.TH Tcl_Namespace 3 8.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+17 -3
View File
@@ -4,12 +4,12 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH Tcl_OpenTcpClient 3 8.0 Tcl "Tcl Library Procedures"
.TH Tcl_OpenTcpClient 3 8.7 Tcl "Tcl Library Procedures"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
Tcl_OpenTcpClient, Tcl_MakeTcpClientChannel, Tcl_OpenTcpServer \- procedures to open channels using TCP sockets
Tcl_OpenTcpClient, Tcl_MakeTcpClientChannel, Tcl_OpenTcpServer, Tcl_OpenTcpServerEx \- procedures to open channels using TCP sockets
.SH SYNOPSIS
.nf
\fB#include <tcl.h> \fR
@@ -23,6 +23,9 @@ Tcl_Channel
Tcl_Channel
\fBTcl_OpenTcpServer\fR(\fIinterp, port, myaddr, proc, clientData\fR)
.sp
Tcl_Channel
\fBTcl_OpenTcpServerEx\fR(\fIinterp, service, myaddr, flags, proc, clientData\fR)
.sp
.SH ARGUMENTS
.AS Tcl_TcpAcceptProc clientData
.AP Tcl_Interp *interp in
@@ -30,6 +33,9 @@ Tcl interpreter to use for error reporting. If non-NULL and an
error occurs, an error message is left in the interpreter's result.
.AP int port in
A port number to connect to as a client or to listen on as a server.
.AP "const char" *service in
A string specifying the port number to connect to as a client or to listen on as
a server.
.AP "const char" *host in
A string specifying a host name or address for the remote end of the connection.
.AP int myport in
@@ -41,6 +47,9 @@ for the local end of the connection. If NULL, a default interface is
chosen.
.AP int async in
If nonzero, the client socket is connected asynchronously to the server.
.AP "unsigned int" flags in
ORed combination of \fBTCL_TCPSERVER\fR flags that specify additional
informations about the socket being created.
.AP ClientData sock in
Platform-specific handle for client TCP socket.
.AP Tcl_TcpAcceptProc *proc in
@@ -130,7 +139,7 @@ for the new channel, \fIhostName\fR points to a string containing
the name of the client host making the connection, and \fIport\fR
will contain the client's port number.
The new channel
is opened for both input and output.
is opened for both input and output.
If \fIproc\fR raises an error, the connection is closed automatically.
\fIProc\fR has no return value, but if it wishes to reject the
connection it can close \fIchannel\fR.
@@ -158,6 +167,11 @@ register it, use \fBTcl_RegisterChannel\fR.
If one of the standard channels, \fBstdin\fR, \fBstdout\fR or \fBstderr\fR was
previously closed, the act of creating the new channel also assigns it as a
replacement for the standard channel.
.SS TCL_OPENTCPSERVEREX
.PP
\fBTcl_OpenTcpServerEx\fR behaviour is identical to \fBTcl_OpenTcpServer\fR but
gives more flexibility to the user by providing a mean to further customize some
aspects of the socket via the \fIflags\fR parameter.
.SH "PLATFORM ISSUES"
.PP
On Unix platforms, the socket handle is a Unix file descriptor as
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_ParseArgsObjv 3 8.6 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_Preserve 3 7.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_PrintDouble 3 8.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -3
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_RecordAndEvalObj 3 8.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
@@ -32,8 +32,6 @@ the command at global level instead of the current stack level.
.PP
\fBTcl_RecordAndEvalObj\fR is invoked to record a command as an event
on the history list and then execute it using \fBTcl_EvalObjEx\fR
(or \fBTcl_GlobalEvalObj\fR if the \fBTCL_EVAL_GLOBAL\fR bit is set
in \fIflags\fR).
It returns a completion code such as \fBTCL_OK\fR just like \fBTcl_EvalObjEx\fR,
as well as a result value containing additional information
(a result value or error message)
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_RecordAndEval 3 7.4 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_SetErrno 3 8.3 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_SetRecursionLimit 3 7.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_SignalId 3 8.3 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_Sleep 3 7.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_SplitList 3 8.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_SplitPath 3 7.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_StaticPackage 3 7.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH "Standard Channels" 3 7.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_StringMatch 3 8.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+43 -1
View File
@@ -8,7 +8,7 @@
.so man.macros
.BS
.SH NAME
Tcl_NewStringObj, Tcl_NewUnicodeObj, Tcl_SetStringObj, Tcl_SetUnicodeObj, Tcl_GetStringFromObj, Tcl_GetString, Tcl_GetUnicodeFromObj, Tcl_GetUnicode, Tcl_GetUniChar, Tcl_GetCharLength, Tcl_GetRange, Tcl_AppendToObj, Tcl_AppendUnicodeToObj, Tcl_AppendObjToObj, Tcl_AppendStringsToObj, Tcl_AppendStringsToObjVA, Tcl_AppendLimitedToObj, Tcl_Format, Tcl_AppendFormatToObj, Tcl_ObjPrintf, Tcl_AppendPrintfToObj, Tcl_SetObjLength, Tcl_AttemptSetObjLength, Tcl_ConcatObj \- manipulate Tcl values as strings
Tcl_NewStringObj, Tcl_NewUnicodeObj, Tcl_SetStringObj, Tcl_SetUnicodeObj, Tcl_GetStringFromObj, Tcl_GetString, Tcl_GetUnicodeFromObj, Tcl_GetUnicode, Tcl_GetUniChar, Tcl_GetCharLength, Tcl_GetRange, Tcl_AppendToObj, Tcl_AppendUnicodeToObj, Tcl_AppendObjToObj, Tcl_AppendStringsToObj, Tcl_AppendStringsToObjVA, Tcl_AppendLimitedToObj, Tcl_Format, Tcl_AppendFormatToObj, Tcl_ObjPrintf, Tcl_AppendPrintfToObj, Tcl_SetObjLength, Tcl_AttemptSetObjLength, Tcl_ConcatObj, Tcl_ReplaceObj \- manipulate Tcl values as strings
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -84,8 +84,13 @@ int
.sp
Tcl_Obj *
\fBTcl_ConcatObj\fR(\fIobjc, objv\fR)
.sp
Tcl_Obj *
\fBTcl_ReplaceObj\fR(\fIinterp, objPtr, startIndex, removeCount, insertObjPtr\fR)
.SH ARGUMENTS
.AS "const Tcl_UniChar" *appendObjPtr in/out
.AP Tcl_Interp *interp in
If non-NULL, interpreter in which error result messages are stored.
.AP "const char" *bytes in
Points to the first byte of an array of UTF-8-encoded bytes
used to set or append to a string value.
@@ -143,6 +148,12 @@ The array of values to format or concatenate.
.AP int newLength in
New length for the string value of \fIobjPtr\fR, not including the
final null character.
.AP int startIndex in
The index of the first character to insert, replace, or remove.
.AP int removeCount in
The number of characters to replace or remove.
.AP Tcl_Obj *insertObjPtr in/out
The value to insert or replace. If NULL, interpreted as empty string.
.BE
.SH DESCRIPTION
.PP
@@ -380,6 +391,37 @@ white space, then that value is ignored entirely. This white-space
removal was added to make the output of the \fBconcat\fR command
cleaner-looking. \fBTcl_ConcatObj\fR returns a pointer to a
newly-created value whose ref count is zero.
.PP
\fBTcl_ReplaceObj\fR inserts, replaces, or removes a substring in \fIobjPtr\fR
and returns a pointer to the new or updated string object.
If \fIobjPtr\fR or \fIinsertObjPtr\fR are unshared, one of them will be modified
in place, and its address will be returned.
If this optimization is unavailable, a new string object will be allocated to
store the result, its address will be returned, and neither \fIobjPtr\fR nor
\fIinsertObjPtr\fR will be modified.
Should a memory allocation error occur, \fBTcl_ReplaceObj\fR returns NULL and
(if \fIinterp\fR is non-NULL) places error information in the result value of
\fIinterp\fR.
.PP
The choice of operation performed by \fBTcl_ReplaceObj\fR is determined by
\fIremoveCount\fR and the length of \fIinsertObjPtr\fR.
To insert, \fIremoveCount\fR is zero, and \fIinsertObjPtr\fR is the insertion
substring.
To replace, \fIremoveCount\fR is the number of characters to replace, and
\fIinsertObjPtr\fR is the replacement substring.
To remove, \fIremoveCount\fR is the number of characters to remove, and
\fIinsertObjPtr\fR is NULL or empty string.
.PP
\fIstartIndex\fR is the index of the first character in \fIobjPtr\fR to insert,
replace, or remove.
Negative \fIstartIndex\fR is taken to be zero, and large \fIstartIndex\fR is
automatically limited to be no greater than the length of \fIobjPtr\fR.
In a similar manner, negative \fIremoveCount\fR is taken to be zero, and large
\fIremoveCount\fR is automatically limited such that the sum of \fIstartIndex\fR
and \fIremoveCount\fR is no greater than the length of \fIobjPtr\fR.
Consequently, if \fIstartIndex\fR is at the end of \fIobjPtr\fR,
\fIinsertObjPtr\fR will be appended to \fIobjPtr\fR, and \fIremoveCount\fR will
be ignored.
.SH "SEE ALSO"
Tcl_NewObj(3), Tcl_IncrRefCount(3), Tcl_DecrRefCount(3), format(n), sprintf(3)
.SH KEYWORDS
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_SubstObj 3 8.4 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+2 -2
View File
@@ -1,8 +1,8 @@
'\"
'\"
'\" Copyright (c) 1992-1999 Karl Lehenbauer and Mark Diekhans.
'\" Copyright (c) 2000 by Scriptics Corporation.
'\" All rights reserved.
'\"
'\"
.TH TCL_MEM_DEBUG 3 8.1 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH TclZlib 3 8.6 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -48,7 +48,7 @@ int
.SH ARGUMENTS
.AS int ch
.AP int ch in
The Tcl_UniChar to be examined.
The Unicode character to be examined.
.BE
.SH DESCRIPTION
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH break n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH case n 7.0 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH cd n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
+6 -7
View File
@@ -89,10 +89,9 @@ have 59 or 61 seconds.
.TP
\fIunit\fR
One of the words, \fBseconds\fR, \fBminutes\fR, \fBhours\fR,
\fBdays\fR, \fBweeks\fR, \fBmonths\fR, or \fByears\fR, or
any unique prefix of such a word. Used in conjunction with \fIcount\fR
to identify an interval of time, for example, \fI3 seconds\fR or
\fI1 year\fR.
\fBdays\fR, \fBweekdays\fR, \fBweeks\fR, \fBmonths\fR, or \fByears\fR.
Used in conjunction with \fIcount\fR to identify an interval of time,
for example, \fI3 seconds\fR or \fI1 year\fR.
.SS "OPTIONS"
.TP
\fB\-base\fR time
@@ -175,8 +174,7 @@ given as its first argument. The remaining arguments (other than the
possible \fB\-timezone\fR, \fB\-locale\fR and \fB\-gmt\fR options)
are integers and keywords in alternation, where the keywords are chosen
from \fBseconds\fR, \fBminutes\fR, \fBhours\fR,
\fBdays\fR, \fBweeks\fR, \fBmonths\fR, or \fByears\fR, or
any unique prefix of such a word.
\fBdays\fR, \fBweekdays\fR, \fBweeks\fR, \fBmonths\fR, or \fByears\fR.
.PP
Addition of seconds, minutes and hours is fairly straightforward;
the given time increment (times sixty for minutes, or 3600 for hours)
@@ -213,7 +211,8 @@ the given time to a calendar day and time of day in the appropriate
time zone and locale. The requisite number of days (weeks are converted
to days by multiplying by seven) is added to the calendar day, and
the date and time are then converted back to a count of seconds from
the epoch time.
the epoch time. The \fBweekdays\fR keyword is similar to \fBdays\fR,
with the only difference that weekends - Saturdays and Sundays - are skipped.
.PP
Adding and subtracting a given number of days across the point that
the time changes at the start or end of summer time (Daylight Saving Time)
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH close n 7.5 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH concat n 8.3 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
+2 -2
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH continue n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
@@ -23,7 +23,7 @@ exception to occur.
The exception causes the current script to be aborted
out to the innermost containing loop command, which then
continues with the next iteration of the loop.
Catch exceptions are also handled in a few other situations, such
Continue exceptions are also handled in a few other situations, such
as the \fBcatch\fR command and the outermost scripts of procedure
bodies.
.SH EXAMPLE
+3 -3
View File
@@ -33,9 +33,9 @@ as the empty string, a new name is chosen. Names, unless specified, are
chosen with the same algorithm used by the \fBnew\fR method of
\fBoo::class\fR.
.VE TIP473
The copied object will be of the same class as the source object, and will have
all its per-object methods copied. If it is a class, it will also have all the
class methods in the class copied, but it will not have any of its instances
The copied object will be of the same class as the source object, and will have
all its per-object methods copied. If it is a class, it will also have all the
class methods in the class copied, but it will not have any of its instances
copied.
.PP
.VS
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH coroutine n 8.6 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
+15
View File
@@ -142,6 +142,8 @@ be afterwards.
\fBself\fI subcommand arg ...\fR
.TP
\fBself\fI script\fR
.TP
\fBself\fR
.
This command is equivalent to calling \fBoo::objdefine\fR on the class being
defined (see \fBCONFIGURING OBJECTS\fR below for a description of the
@@ -151,6 +153,13 @@ and
.QW "\fBoo::define \fIcls \fBself \fIsubcommand ...\fR"
operates identically to
.QW "\fBoo::objdefine \fIcls subcommand ...\fR" .
.RS
.PP
.VS TIP470
If no arguments at all are used, this gives the name of the class currently
being configured.
.VE TIP470
.RE
.TP
\fBsuperclass\fR ?\fI\-slotOperation\fR? ?\fIclassName ...\fR?
.VS
@@ -265,6 +274,12 @@ not previously refer to a method in that object. Does not affect the classes
that the object is an instance of. Does not change the export status of the
method; if it was exported before, it will be afterwards.
.TP
\fBself \fR
.
.VS TIP470
This gives the name of the object currently being configured.
.VE TIP470
.TP
\fBunexport\fI name \fR?\fIname ...\fR?
.
This arranges for each of the named methods, \fIname\fR, to be not exported
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH eof n 7.5 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH eval n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH exit n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
+172 -214
View File
@@ -17,14 +17,14 @@ expr \- Evaluate an expression
.BE
.SH DESCRIPTION
.PP
Concatenates \fIarg\fRs (adding separator spaces between them),
evaluates the result as a Tcl expression, and returns the value.
The operators permitted in Tcl expressions include a subset of
Concatenates \fIarg\fRs, separated by a space, into an expression, and evaluates
that expression, returning its value.
The operators permitted in an expression include a subset of
the operators permitted in C expressions. For those operators
common to both Tcl and C, Tcl applies the same meaning and precedence
as the corresponding C operators.
Expressions almost always yield numeric results
(integer or floating-point values).
The value of an expression is often a numeric result, either an integer or a
floating-point value, but may also be a non-numeric value.
For example, the expression
.PP
.CS
@@ -32,78 +32,69 @@ For example, the expression
.CE
.PP
evaluates to 14.2.
Tcl expressions differ from C expressions in the way that
operands are specified. Also, Tcl expressions support
non-numeric operands and string comparisons, as well as some
Expressions differ from C expressions in the way that
operands are specified. Expressions also support
non-numeric operands, string comparisons, and some
additional operators not found in C.
.PP
When an expression evaluates to an integer, the value is the decimal form of
the integer, and when an expression evaluates to a floating-point number, the
value is the form produced by the \fB%g\fR format specifier of Tcl's
\fBformat\fR command.
.SS OPERANDS
.PP
A Tcl expression consists of a combination of operands, operators,
parentheses and commas.
White space may be used between the operands and operators and
parentheses (or commas); it is ignored by the expression's instructions.
Where possible, operands are interpreted as integer values.
Integer values may be specified in decimal (the normal case), in binary
(if the first two characters of the operand are \fB0b\fR), in octal
(if the first two characters of the operand are \fB0o\fR), or in hexadecimal
(if the first two characters of the operand are \fB0x\fR). For
compatibility with older Tcl releases, an octal integer value is also
indicated simply when the first character of the operand is \fB0\fR,
whether or not the second character is also \fBo\fR.
If an operand does not have one of the integer formats given
above, then it is treated as a floating-point number if that is
possible. Floating-point numbers may be specified in any of several
common formats making use of the decimal digits, the decimal point \fB.\fR,
the characters \fBe\fR or \fBE\fR indicating scientific notation, and
the sign characters \fB+\fR or \fB\-\fR. For example, all of the
following are valid floating-point numbers: 2.1, 3., 6e4, 7.91e+16.
Also recognized as floating point values are the strings \fBInf\fR
and \fBNaN\fR making use of any case for each character.
If no numeric interpretation is possible (note that all literal
operands that are not numeric or boolean must be quoted with either
braces or with double quotes), then an operand is left as a string
(and only a limited set of operators may be applied to it).
An expression consists of a combination of operands, operators, parentheses and
commas, possibly with whitespace between any of these elements, which is
ignored.
An integer operand may be specified in decimal (the normal case, the optional
first two characters are \fB0d\fR), binary
(the first two characters are \fB0b\fR), octal
(the first two characters are \fB0o\fR), or hexadecimal
(the first two characters are \fB0x\fR) form. For
compatibility with older Tcl releases, an operand that begins with \fB0\fR is
interpreted as an octal integer even if the second character is not \fBo\fR.
A floating-point number may be specified in any of several
common decimal formats, and may use the decimal point \fB.\fR,
\fBe\fR or \fBE\fR for scientific notation, and
the sign characters \fB+\fR and \fB\-\fR. The
following are all valid floating-point numbers: 2.1, 3., 6e4, 7.91e+16.
The strings \fBInf\fR
and \fBNaN\fR, in any combination of case, are also recognized as floating point
values. An operand that doesn't have a numeric interpretation must be quoted
with either braces or with double quotes.
.PP
Operands may be specified in any of the following ways:
An operand may be specified in any of the following ways:
.IP [1]
As a numeric value, either integer or floating-point.
.IP [2]
As a boolean value, using any form understood by \fBstring is\fR
\fBboolean\fR.
.IP [3]
As a Tcl variable, using standard \fB$\fR notation.
The variable's value will be used as the operand.
As a variable, using standard \fB$\fR notation.
The value of the variable is then the value of the operand.
.IP [4]
As a string enclosed in double-quotes.
The expression parser will perform backslash, variable, and
command substitutions on the information between the quotes,
and use the resulting value as the operand
Backslash, variable, and command substitution are performed as described in
\fBTcl\fR.
.IP [5]
As a string enclosed in braces.
The characters between the open brace and matching close brace
will be used as the operand without any substitutions.
The operand is treated as a braced value as described in \fBTcl\fR.
.IP [6]
As a Tcl command enclosed in brackets.
The command will be executed and its result will be used as
the operand.
Command substitution is performed as described in \fBTcl\fR.
.IP [7]
As a mathematical function whose arguments have any of the above
forms for operands, such as \fBsin($x)\fR. See \fBMATH FUNCTIONS\fR below for
As a mathematical function such as \fBsin($x)\fR, whose arguments have any of the above
forms for operands. See \fBMATH FUNCTIONS\fR below for
a discussion of how mathematical functions are handled.
.PP
Where the above substitutions occur (e.g. inside quoted strings), they
are performed by the expression's instructions.
However, the command parser may already have performed one round of
substitution before the expression processor was called.
As discussed below, it is usually best to enclose expressions
in braces to prevent the command parser from performing substitutions
on the contents.
Because \fBexpr\fR parses and performs substitutions on values that have
already been parsed and substituted by \fBTcl\fR, it is usually best to enclose
expressions in braces to avoid the first round of substitutions by
\fBTcl\fR.
.PP
For some examples of simple expressions, suppose the variable
\fBa\fR has the value 3 and
the variable \fBb\fR has the value 6.
Then the command on the left side of each of the lines below
will produce the value on the right side of the line:
Below are some examples of simple expressions where the value of \fBa\fR is 3
and the value of \fBb\fR is 6. The command on the left side of each line
produces the value on the right side.
.PP
.CS
.ta 6c
@@ -114,34 +105,41 @@ will produce the value on the right side of the line:
.CE
.SS OPERATORS
.PP
The valid operators (most of which are also available as commands in
the \fBtcl::mathop\fR namespace; see the \fBmathop\fR(n) manual page
for details) are listed below, grouped in decreasing order of precedence:
For operators having both a numeric mode and a string mode, the numeric mode is
chosen when all operands have a numeric interpretation. The integer
interpretation of an operand is preferred over the floating-point
interpretation. To ensure string operations on arbitrary values it is generally a
good idea to use \fBeq\fR, \fBne\fR, or the \fBstring\fR command instead of
more versatile operators such as \fB==\fR.
.PP
Unless otherwise specified, operators accept non-numeric operands. The value
of a boolean operation is 1 if true, 0 otherwise. See also \fBstring is\fR
\fBboolean\fR. The valid operators, most of which are also available as
commands in the \fBtcl::mathop\fR namespace (see \fBmathop\fR(n)), are listed
below, grouped in decreasing order of precedence:
.TP 20
\fB\-\0\0+\0\0~\0\0!\fR
.
Unary minus, unary plus, bit-wise NOT, logical NOT. None of these operators
may be applied to string operands, and bit-wise NOT may be
applied only to integers.
Unary minus, unary plus, bit-wise NOT, logical NOT. These operators
may only be applied to numeric operands, and bit-wise NOT may only be
applied to integers.
.TP 20
\fB**\fR
.
Exponentiation. Valid for any numeric operands.
Exponentiation. Valid for numeric operands.
.TP 20
\fB*\0\0/\0\0%\fR
.
Multiply, divide, remainder. None of these operators may be
applied to string operands, and remainder may be applied only
to integers.
The remainder will always have the same sign as the divisor and
an absolute value smaller than the absolute value of the divisor.
Multiply and divide, which are valid for numeric operands, and remainder, which
is valid for integers. The remainder, an absolute value smaller than the
absolute value of the divisor, has the same sign as the divisor.
.RS
.PP
When applied to integers, the division and remainder operators can be
considered to partition the number line into a sequence of equal-sized
adjacent non-overlapping pieces where each piece is the size of the divisor;
the division result identifies which piece the divisor lay within, and the
remainder result identifies where within that piece the divisor lay. A
When applied to integers, division and remainder can be
considered to partition the number line into a sequence of
adjacent non-overlapping pieces, where each piece is the size of the divisor;
the quotient identifies which piece the dividend lies within, and the
remainder identifies where within that piece the dividend lies. A
consequence of this is that the result of
.QW "-57 \fB/\fR 10"
is always -6, and the result of
@@ -151,177 +149,157 @@ is always 3.
.TP 20
\fB+\0\0\-\fR
.
Add and subtract. Valid for any numeric operands.
Add and subtract. Valid for numeric operands.
.TP 20
\fB<<\0\0>>\fR
.
Left and right shift. Valid for integer operands only.
Left and right shift. Valid for integers.
A right shift always propagates the sign bit.
.TP 20
\fB<\0\0>\0\0<=\0\0>=\fR
.
Boolean less, greater, less than or equal, and greater than or equal.
Each operator produces 1 if the condition is true, 0 otherwise.
These operators may be applied to strings as well as numeric operands,
in which case string comparison is used.
Boolean less than, greater than, less than or equal, and greater than or equal.
.TP 20
\fB==\0\0!=\fR
.
Boolean equal and not equal. Each operator produces a zero/one result.
Valid for all operand types.
Boolean equal and not equal.
.TP 20
\fBeq\0\0ne\fR
.
Boolean string equal and string not equal. Each operator produces a
zero/one result. The operand types are interpreted only as strings.
Boolean string equal and string not equal.
.TP 20
\fBin\0\0ni\fR
.
List containment and negated list containment. Each operator produces
a zero/one result and treats its first argument as a string and its
second argument as a Tcl list. The \fBin\fR operator indicates
whether the first argument is a member of the second argument list;
the \fBni\fR operator inverts the sense of the result.
List containment and negated list containment. The first argument is
interpreted as a string, the second as a list. \fBin\fR tests for membership
in the list, and \fBni\fR is the inverse.
.TP 20
\fB&\fR
.
Bit-wise AND. Valid for integer operands only.
Bit-wise AND. Valid for integer operands.
.TP 20
\fB^\fR
.
Bit-wise exclusive OR. Valid for integer operands only.
Bit-wise exclusive OR. Valid for integer operands.
.TP 20
\fB|\fR
.
Bit-wise OR. Valid for integer operands only.
Bit-wise OR. Valid for integer operands.
.TP 20
\fB&&\fR
.
Logical AND. Produces a 1 result if both operands are non-zero,
0 otherwise.
Valid for boolean and numeric (integers or floating-point) operands only.
Logical AND. If both operands are true, the result is 1, or 0 otherwise.
.TP 20
\fB||\fR
.
Logical OR. Produces a 0 result if both operands are zero, 1 otherwise.
Valid for boolean and numeric (integers or floating-point) operands only.
Logical OR. If both operands are false, the result is 0, or 1 otherwise.
.TP 20
\fIx\fB?\fIy\fB:\fIz\fR
.
If-then-else, as in C. If \fIx\fR
evaluates to non-zero, then the result is the value of \fIy\fR.
Otherwise the result is the value of \fIz\fR.
The \fIx\fR operand must have a boolean or numeric value.
If-then-else, as in C. If \fIx\fR is false , the result is the value of
\fIy\fR. Otherwise the result is the value of \fIz\fR.
.PP
See the C manual for more details on the results
produced by each operator.
The exponentiation operator promotes types like the multiply and
divide operators, and produces a result that is the same as the output
of the \fBpow\fR function (after any type conversions.)
All of the binary operators but exponentiation group left-to-right
within the same precedence level; exponentiation groups right-to-left. For example, the command
The exponentiation operator promotes types in the same way that the multiply
and divide operators do, and the result is is the same as the result of
\fBpow\fR.
Exponentiation groups right-to-left within a precedence level. Other binary
operators group left-to-right. For example, the value of
.PP
.CS
\fBexpr\fR {4*2 < 7}
.CE
.PP
returns 0, while
is 0, while the value of
.PP
.CS
\fBexpr\fR {2**3**2}
.CE
.PP
returns 512.
is 512.
.PP
The \fB&&\fR, \fB||\fR, and \fB?:\fR operators have
As in C, \fB&&\fR, \fB||\fR, and \fB?:\fR feature
.QW "lazy evaluation" ,
just as in C, which means that operands are not evaluated if they are
not needed to determine the outcome. For example, in the command
which means that operands are not evaluated if they are
not needed to determine the outcome. For example, in
.PP
.CS
\fBexpr\fR {$v ? [a] : [b]}
.CE
.PP
only one of
.QW \fB[a]\fR
or
.QW \fB[b]\fR
will actually be evaluated,
depending on the value of \fB$v\fR. Note, however, that this is
only true if the entire expression is enclosed in braces; otherwise
the Tcl parser will evaluate both
.QW \fB[a]\fR
and
.QW \fB[b]\fR
before invoking the \fBexpr\fR command.
only one of \fB[a]\fR or \fB[b]\fR is evaluated,
depending on the value of \fB$v\fR. This is not true of the normal Tcl parser,
so it is normally recommended to enclose the arguments to \fBexpr\fR in braces.
Without braces, as in
\fBexpr\fR $v ? [a] : [b]
both \fB[a]\fR and \fB[b]\fR are evaluated before \fBexpr\fR is even called.
.PP
For more details on the results
produced by each operator, see the documentation for C.
.SS "MATH FUNCTIONS"
.PP
When the expression parser encounters a mathematical function
such as \fBsin($x)\fR, it replaces it with a call to an ordinary
Tcl function in the \fBtcl::mathfunc\fR namespace. The processing
of an expression such as:
A mathematical function such as \fBsin($x)\fR is replaced with a call to an ordinary
Tcl command in the \fBtcl::mathfunc\fR namespace. The evaluation
of an expression such as
.PP
.CS
\fBexpr\fR {sin($x+$y)}
.CE
.PP
is the same in every way as the processing of:
is the same in every way as the evaluation of
.PP
.CS
\fBexpr\fR {[tcl::mathfunc::sin [\fBexpr\fR {$x+$y}]]}
.CE
.PP
which in turn is the same as the processing of:
which in turn is the same as the evaluation of
.PP
.CS
tcl::mathfunc::sin [\fBexpr\fR {$x+$y}]
.CE
.PP
The executor will search for \fBtcl::mathfunc::sin\fR using the usual
rules for resolving functions in namespaces. Either
\fB::tcl::mathfunc::sin\fR or \fB[namespace
current]::tcl::mathfunc::sin\fR will satisfy the request, and others
may as well (depending on the current \fBnamespace path\fR setting).
\fBtcl::mathfunc::sin\fR is resolved as described in
\fBNAMESPACE RESOLUTION\fR in the \fBnamespace\fR(n) documentation. Given the
default value of \fBnamespace path\fR, \fB[namespace
current]::tcl::mathfunc::sin\fR or \fB::tcl::mathfunc::sin\fR are the typical
resolutions.
.PP
Some mathematical functions have several arguments, separated by commas like in C. Thus:
As in C, a mathematical function may accept multiple arguments separated by commas. Thus,
.PP
.CS
\fBexpr\fR {hypot($x,$y)}
.CE
.PP
ends up as
becomes
.PP
.CS
tcl::mathfunc::hypot $x $y
.CE
.PP
See the \fBmathfunc\fR(n) manual page for the math functions that are
See the \fBmathfunc\fR(n) documentation for the math functions that are
available by default.
.SS "TYPES, OVERFLOW, AND PRECISION"
.PP
All internal computations involving integers are done calling on the
LibTomMath multiple precision integer library as required so that all
integer calculations are performed exactly. Note that in Tcl releases
prior to 8.5, integer calculations were performed with one of the C types
When needed to guarantee exact performance, internal computations involving
integers use the LibTomMath multiple precision integer library. In Tcl releases
prior to 8.5, integer calculations were performed using one of the C types
\fIlong int\fR or \fITcl_WideInt\fR, causing implicit range truncation
in those calculations where values overflowed the range of those types.
Any code that relied on these implicit truncations will need to explicitly
add \fBint()\fR or \fBwide()\fR function calls to expressions at the points
where such truncation is required to take place.
Any code that relied on these implicit truncations should instead call
\fBint()\fR or \fBwide()\fR, which do truncate.
.PP
All internal computations involving floating-point are
done with the C type \fIdouble\fR.
When converting a string to floating-point, exponent overflow is
Internal floating-point computations are
performed using the \fIdouble\fR C type.
When converting a string to floating-point value, exponent overflow is
detected and results in the \fIdouble\fR value of \fBInf\fR or
\fB\-Inf\fR as appropriate. Floating-point overflow and underflow
are detected to the degree supported by the hardware, which is generally
pretty reliable.
fairly reliable.
.PP
Conversion among internal representations for integer, floating-point,
and string operands is done automatically as needed.
For arithmetic computations, integers are used until some
floating-point number is introduced, after which floating-point is used.
For example,
Conversion among internal representations for integer, floating-point, and
string operands is done automatically as needed. For arithmetic computations,
integers are used until some floating-point number is introduced, after which
floating-point values are used. For example,
.PP
.CS
\fBexpr\fR {5 / 4}
@@ -335,82 +313,62 @@ returns 1, while
.CE
.PP
both return 1.25.
Floating-point values are always returned with a
A floating-point result can be distinguished from an integer result by the
presence of either
.QW \fB.\fR
or an
or
.QW \fBe\fR
so that they will not look like integer values. For example,
.PP
. For example,
.PP
.CS
\fBexpr\fR {20.0/5.0}
.CE
.PP
returns \fB4.0\fR, not \fB4\fR.
.SS "STRING OPERATIONS"
.PP
String values may be used as operands of the comparison operators,
although the expression evaluator tries to do comparisons as integer
or floating-point when it can,
i.e., when all arguments to the operator allow numeric interpretations,
except in the case of the \fBeq\fR and \fBne\fR operators.
If one of the operands of a comparison is a string and the other
has a numeric value, a canonical string representation of the numeric
operand value is generated to compare with the string operand.
Canonical string representation for integer values is a decimal string
format. Canonical string representation for floating-point values
is that produced by the \fB%g\fR format specifier of Tcl's
\fBformat\fR command. For example, the commands
.PP
.CS
\fBexpr\fR {"0x03" > "2"}
\fBexpr\fR {"0y" > "0x12"}
.CE
.PP
both return 1. The first comparison is done using integer
comparison, and the second is done using string comparison.
Because of Tcl's tendency to treat values as numbers whenever
possible, it is not generally a good idea to use operators like \fB==\fR
when you really want string comparison and the values of the
operands could be arbitrary; it is better in these cases to use
the \fBeq\fR or \fBne\fR operators, or the \fBstring\fR command instead.
.SH "PERFORMANCE CONSIDERATIONS"
.PP
Enclose expressions in braces for the best speed and the smallest
storage requirements.
This allows the Tcl bytecode compiler to generate the best code.
.PP
As mentioned above, expressions are substituted twice:
once by the Tcl parser and once by the \fBexpr\fR command.
For example, the commands
Where an expression contains syntax that Tcl would otherwise perform
substitutions on, enclosing an expression in braces or otherwise quoting it
so that it's a static value allows the Tcl compiler to generate bytecode for
the expression, resulting in better speed and smaller storage requirements.
This also avoids issues that can arise if Tcl is allowed to perform
substitution on the value before \fBexpr\fR is called.
.PP
In the following example, the value of the expression is 11 because the Tcl parser first
substitutes \fB$b\fR and \fBexpr\fR then substitutes \fB$a\fR. Enclosing the
expression in braces would result in a syntax error.
.CS
set a 3
set b {$a + 2}
\fBexpr\fR $b*4
.CE
.PP
return 11, not a multiple of 4.
This is because the Tcl parser will first substitute \fB$a + 2\fR for
the variable \fBb\fR,
then the \fBexpr\fR command will evaluate the expression \fB$a + 2*4\fR.
.PP
Most expressions do not require a second round of substitutions.
Either they are enclosed in braces or, if not,
their variable and command substitutions yield numbers or strings
that do not themselves require substitutions.
However, because a few unbraced expressions
need two rounds of substitutions,
the bytecode compiler must emit
additional instructions to handle this situation.
The most expensive code is required for
unbraced expressions that contain command substitutions.
These expressions must be implemented by generating new code
each time the expression is executed.
When the expression is unbraced to allow the substitution of a function or
operator, consider using the commands documented in the \fBmathfunc\fR(n) or
\fBmathop\fR(n) manual pages directly instead.
When an expression is generated at runtime, like the one above is, the bytcode
compiler must ensure that new code is generated each time the expression
is evaluated. This is the most costly kind of expression from a performance
perspective. In such cases, consider directly using the commands described in
the \fBmathfunc\fR(n) or \fBmathop\fR(n) documentation instead of \fBexpr\fR.
Most expressions are not formed at runtime, but are literal strings or contain
substitutions that don't introduce other substitutions. To allow the bytecode
compiler to work with an expression as a string literal at compilation time,
ensure that it contains no substitutions or that it is enclosed in braces or
otherwise quoted to prevent Tcl from performing substitutions, allowing
\fBexpr\fR to perform them instead.
.SH EXAMPLES
.PP
A numeric comparison whose result is 1:
.CS
\fBexpr\fR {"0x03" > "2"}
.CE
.PP
A string comparison whose result is 1:
.CS
\fBexpr\fR {"0y" > "0x12"}
.CE
.PP
Define a procedure that computes an
.QW interesting
mathematical function:
@@ -444,8 +402,8 @@ each other:
puts "a and b are [\fBexpr\fR {$a eq $b ? {equal} : {different}}]"
.CE
.PP
Set a variable to whether an environment variable is both defined at
all and also set to a true boolean value:
Set a variable indicating whether an environment variable is defined and has
value of true:
.PP
.CS
set isTrue [\fBexpr\fR {
+1 -1
View File
@@ -1,4 +1,4 @@
'\"
'\"
'\" Copyright (c) 1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
+1 -1
View File
@@ -390,7 +390,7 @@ that use the third component do not attempt to perform tilde
substitution.
.RE
.TP
\fBfile stat \fIname varName\fR
\fBfile stat \fIname varName\fR
.
Invokes the \fBstat\fR kernel call on \fIname\fR, and uses the variable
given by \fIvarName\fR to hold information returned from the kernel call.
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH flush n 7.5 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH foreach n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
+22 -7
View File
@@ -83,12 +83,15 @@ Specifies that the number should be padded on the left with
zeroes instead of spaces.
.TP 10
\fB#\fR
Requests an alternate output form. For \fBo\fR
conversions it guarantees that the first digit is always \fB0\fR.
For \fBx\fR or \fBX\fR conversions, \fB0x\fR or \fB0X\fR (respectively)
Requests an alternate output form. For \fBo\fR conversions,
\fB0o\fR will be added to the beginning of the result unless
it is zero. For \fBx\fR or \fBX\fR conversions, \fB0x\fR
will be added to the beginning of the result unless it is zero.
For \fBb\fR conversions, \fB0b\fR
will be added to the beginning of the result unless it is zero.
For \fBd\fR conversions, \fB0d\fR there is no effect unless
the \fB0\fR specifier is used as well: In that case, \fB0d\fR
will be added to the beginning.
For all floating-point conversions (\fBe\fR, \fBE\fR, \fBf\fR,
\fBg\fR, and \fBG\fR) it guarantees that the result always
has a decimal point.
@@ -130,7 +133,7 @@ it must be a numeric string.
.SS "OPTIONAL SIZE MODIFIER"
.PP
The fifth part of a conversion specifier is a size modifier,
which must be \fBll\fR, \fBh\fR, or \fBl\fR.
which must be \fBll\fR, \fBh\fR, \fBl\fR, or \fBL\fR.
If it is \fBll\fR it specifies that an integer value is taken
without truncation for conversion to a formatted substring.
If it is \fBh\fR it specifies that an integer value is
@@ -138,7 +141,9 @@ truncated to a 16-bit range before converting. This option is rarely useful.
If it is \fBl\fR it specifies that the integer value is
truncated to the same range as that produced by the \fBwide()\fR
function of the \fBexpr\fR command (at least a 64-bit range).
If neither \fBh\fR nor \fBl\fR are present, the integer value is
If it is \fBL\fR it specifies that an integer or double value is taken
without truncation for conversion to a formatted substring.
If neither \fBh\fR nor \fBl\fR nor \fBL\fR are present, the integer value is
truncated to the same range as that produced by the \fBint()\fR
function of the \fBexpr\fR command (at least a 32-bit range, but
determined by the value of the \fBwordSize\fR element of the
@@ -198,8 +203,19 @@ precision, then convert number as for \fB%e\fR or
Otherwise convert as for \fB%f\fR.
Trailing zeroes and a trailing decimal point are omitted.
.TP 10
\fBa\fR or \fBA\fR
Convert double to hexadecimal notation in the form
\fI0x1.yyy\fBp\(+-\fIzz\fR, where the number of \fIy\fR's is
determined by the precision (default: 13).
If the \fBA\fR form is used then the hex characters
are printed in uppercase.
.TP 10
\fB%\fR
No conversion: just insert \fB%\fR.
.TP 10
\fBp\fR
Shorthand form for \fB0x%zx\fR, so it outputs the integer in
hexadecimal form with \fB0x\fR prefix.
.SH "DIFFERENCES FROM ANSI SPRINTF"
.PP
The behavior of the format command is the same as the
@@ -208,13 +224,12 @@ differences:
.IP [1]
Tcl guarantees that it will be working with UNICODE characters.
.IP [2]
\fB%p\fR and \fB%n\fR specifiers are not supported.
\fB%n\fR specifier is not supported.
.IP [3]
For \fB%c\fR conversions the argument must be an integer value,
which will then be converted to the corresponding character value.
.IP [4]
The size modifiers are ignored when formatting floating-point values.
The \fBll\fR modifier has no \fBsprintf\fR counterpart.
The \fBb\fR specifier has no \fBsprintf\fR counterpart.
.SH EXAMPLES
.PP
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH gets n 7.5 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH history n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH if n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH incr n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
+5 -4
View File
@@ -7,7 +7,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH info n 8.4 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
@@ -297,10 +297,11 @@ scripts are stored.
This is actually the value of the \fBtcl_library\fR
variable and may be changed by setting \fBtcl_library\fR.
.TP
\fBinfo loaded \fR?\fIinterp\fR?
\fBinfo loaded \fR?\fIinterp\fR? ?\fIpackage\fR?
.
Returns a list describing all of the packages that have been loaded into
\fIinterp\fR with the \fBload\fR command.
Returns the filename loaded as part of \fIpackage\fR. If \fIpackage\fR
is not specified, returns a list describing all of the packages
that have been loaded into \fIinterp\fR with the \fBload\fR command.
Each list element is a sub-list with two elements consisting of the
name of the file from which the package was loaded and the name of
the package.
+1 -1
View File
@@ -5,7 +5,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH interp n 8.6 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH join n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
+1 -1
View File
@@ -5,7 +5,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH lappend n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH lassign n 8.5 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
+1 -1
View File
@@ -5,7 +5,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH list n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH load n 7.5 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH lrepeat n 8.5 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH lreverse n 8.5 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
+1 -1
View File
@@ -303,7 +303,7 @@ used for qualified namespace or variable names.
Sets or returns the unknown command handler for the current namespace.
The handler is invoked when a command called from within the namespace
cannot be found in the current namespace, the namespace's path nor in
the global namespace.
the global namespace.
The \fIscript\fR argument, if given, should be a well
formed list representing a command name and optional arguments. When
the handler is invoked, the full invocation line will be appended to the
+1 -1
View File
@@ -138,7 +138,7 @@ before chaining from subclass, args = x 1 2 3 y
in the superclass, args = a x 1 2 3 y b
in the superclass, args = pureSynthesis
after chaining from subclass
before chaining from subclass, args =
before chaining from subclass, args =
in the superclass, args = a b
in the superclass, args = pureSynthesis
after chaining from subclass
+10 -2
View File
@@ -12,6 +12,7 @@
package \- Facilities for package loading and version control
.SH SYNOPSIS
.nf
\fBpackage files\fR \fIpackage\fR
\fBpackage forget\fR ?\fIpackage package ...\fR?
\fBpackage ifneeded \fIpackage version\fR ?\fIscript\fR?
\fBpackage names\fR
@@ -43,6 +44,13 @@ primarily by system scripts that maintain the package database.
The behavior of the \fBpackage\fR command is determined by its first argument.
The following forms are permitted:
.TP
\fBpackage files\fR \fIpackage\fR
.
Lists all files forming part of \fIpackage\fR. Auto-loaded files are not
included in this list, only files which were directly sourced during package
initialization. The list order corresponds with the order in which the
files were sourced.
.TP
\fBpackage forget\fR ?\fIpackage package ...\fR?
.
Removes all information about each specified package from this interpreter,
@@ -283,8 +291,8 @@ error.
.PP
When an interpreter is created, its initial selection mode value is set to
.QW stable
unless the environment variable \fBTCL_PKG_PREFER_LATEST\fR
is set. If that environment variable is defined (with any value) then
unless the environment variable \fBTCL_PKG_PREFER_LATEST\fR is set
(to any value) or the Tcl package itself is unstable. Otherwise
the initial (and permanent) selection mode value is set to
.QW latest .
.RE
+1 -1
View File
@@ -1,7 +1,7 @@
'\"
'\" Copyright (c) 1998-2000 by Scriptics Corporation.
'\" All rights reserved.
'\"
'\"
.TH pkg::create n 8.3 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH pid n 7.0 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH "platform" n 1.0.4 platform "Tcl Bundled Packages"
.so man.macros
.BS
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH "platform::shell" n 1.1.4 platform::shell "Tcl Bundled Packages"
.so man.macros
.BS
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH prefix n 8.6 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH puts n 7.5 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH pwd n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
+3 -3
View File
@@ -293,12 +293,12 @@ treatment is as if the enclosing delimiters were
.QW \fB[.\fR \&
and
.QW \fB.]\fR .)
For example, if \fBo\fR and \fB\*(qo\fR are the members of an
For example, if \fBo\fR and \fB\[^o]\fR are the members of an
equivalence class, then
.QW \fB[[=o=]]\fR ,
.QW \fB[[=\*(qo=]]\fR ,
.QW \fB[[=\[^o]=]]\fR ,
and
.QW \fB[o\*(qo]\fR \&
.QW \fB[o\[^o]]\fR \&
are all synonymous. An equivalence class may not be an endpoint of a range.
.RS
.PP
+1 -1
View File
@@ -1,4 +1,4 @@
'\"
'\"
'\" Copyright (c) 2006 Andreas Kupries <andreas_kupries@users.sourceforge.net>
'\"
'\" See the file "license.terms" for information on usage and redistribution
+1 -1
View File
@@ -152,7 +152,7 @@ nulls.
.TP
\fBsz\fR
.
The registry value contains a null-terminated string. The data is
The registry value contains a null-terminated string. The data is
represented in Tcl as a string.
.TP
\fBexpand_sz\fR
+74
View File
@@ -68,6 +68,33 @@ and
sequences are handled for each substitution using the information
from the corresponding match.
.TP
\fB\-command\fR
.VS 8.7
Changes the handling of \fIsubSpec\fR so that it is not treated
as a template for a substitution string and the substrings
.QW &
and
.QW \e\fIn\fR
no longer have special meaning. Instead \fIsubSpec\fR must be a
command prefix, that is, a non-empty list. The substring of \fIstring\fR
that matches \fIexp\fR, and then each substring that matches each
capturing sub-RE within \fIexp\fR are appended as additional elements
to that list. (The items appended to the list are much like what
\fBregexp\fR \fB-inline\fR would return). The completed list is then
evaluated as a Tcl command, and the result of that command is the
substitution string. Any error or exception from command evaluation
becomes an error or exception from the \fBregsub\fR command.
.RS
.PP
If \fB\-all\fR is not also given, the command callback will be invoked at most
once (exactly when the regular expression matches). If \fB\-all\fR is given,
the command callback will be invoked for each matched location, in sequence.
The exact location indices that matched are not made available to the script.
.PP
See \fBEXAMPLES\fR below for illustrative cases.
.RE
.VE 8.7
.TP
\fB\-expanded\fR
.
Enables use of the expanded regular expression syntax where
@@ -183,6 +210,53 @@ set substitution {[format \e\e\e\eu%04x [scan "\e\e&" %c]]}
set quoted [subst [string map {\en {\e\eu000a}} \e
[\fBregsub\fR -all $RE $string $substitution]]]
.CE
.PP
.VS 8.7
The above operation can be done using \fBregsub \-command\fR instead, which is
often faster. (A full pre-computed \fBstring map\fR would be faster still, but
the cost of computing the map for a transformation as complex as this can be
quite large.)
.PP
.CS
# This RE is just a character class for everything "bad"
set RE {[][{};#\e\e\e$\es\eu0080-\euffff]}
# This encodes what the RE described above matches
proc encodeChar {ch} {
# newline is handled specially since backslash-newline is a
# special sequence.
if {$ch eq "\en"} {
return "\e\eu000a"
}
# No point in writing this as a one-liner
scan $ch %c charNumber
format "\e\eu%04x" $charNumber
}
set quoted [\fBregsub\fR -all -command $RE $string encodeChar]
.CE
.PP
Decoding a URL-encoded string using \fBregsub \-command\fR, a lambda term and
the \fBapply\fR command.
.PP
.CS
# Match one of the sequences in a URL-encoded string that needs
# fixing, converting + to space and %XX to the right character
# (e.g., %7e becomes ~)
set RE {(\e+)|%([0-9A-Fa-f]{2})}
# Note that -command uses a command prefix, not a command name
set decoded [\fBregsub\fR -all -command $RE $string {apply {{- p h} {
# + is a special case; handle directly
if {$p eq "+"} {
return " "
}
# convert hex to a char
scan $h %x charNumber
format %c $charNumber
}}}]
.CE
.VE 8.7
.SH "SEE ALSO"
regexp(n), re_syntax(n), subst(n), string(n)
.SH KEYWORDS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH rename n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS

Some files were not shown because too many files have changed in this diff Show More