Compare commits

...
Author SHA1 Message Date
jan.nijtmans ba9cf35aa3 In case of redirecting stderr to a file on Windows, append CRLF after Panic output. 2018-03-15 23:01:00 +00:00
jan.nijtmans db41a49d9c merge 8.7 2018-03-15 21:53:00 +00:00
jan.nijtmans df06afadcf Bring back makefile.vc to CRLF line-endings, as all other *.vc files 2018-03-15 20:58:00 +00:00
dgp aa199edba6 merge 8.6 2018-03-15 11:08:08 +00:00
dgp c5e979695a Missing test cleanups that break later tests. 2018-03-15 10:58:13 +00:00
dgp 5d355c0fd9 Memleak and lifetime management fixes for components of the OO system. 2018-03-14 23:54:31 +00:00
dgp e6e44fb3b8 Merge rest of 8.7 except the botched apply/backout dance. 2018-03-14 23:47:46 +00:00
dgp 6fcbcd9f12 Merge in 8.7 changes not already here. 2018-03-14 23:43:32 +00:00
dgp 4751bcf256 Rebase the memleak work. 2018-03-14 22:39:38 +00:00
dgp 99ab923ed5 Memleak and lifetime management fixes for components of the OO system. 2018-03-14 22:17:51 +00:00
dgp 72c721f3e7 merge 8.6 2018-03-14 21:51:13 +00:00
dgp 6d4320b5fb A few test hygiene fixes. 2018-03-14 20:59:01 +00:00
pooryorick 73de582148 Further work to improve Object reference accounting in order to plug leaks. 2018-03-14 20:43:20 +00:00
dgp d0bce3e99f merge 8.6 2018-03-14 18:08:55 +00:00
sebres 1bf60bab3c optimize compiled (INST_STR_TRIM): use new function TclTrim instead of combination of TclTrimLeft/TclTrimRight 2018-03-14 17:23:24 +00:00
dgp 43f670e530 unused variable fix 2018-03-14 17:20:53 +00:00
sebres 77ab9f868a merge 8.5 2018-03-14 17:19:23 +00:00
sebres 6e7c474da7 TclTrim: special case for TrimRight on single char result of TrimLeft (this char is already verified within TrimLeft, so bypass TrimRight at all) 2018-03-14 17:17:44 +00:00
dgp 2d87ed6d29 New routine TclStringReplace() serves as a common implementation for both
compiled and direct eval paths of [string replace].
One routine to debug, optimize, convert to new data structures, etc.

This routine will also make a good core engine for [string insert].

With this refactoring done, the value of the INST_STR_REPLACE instruction
is no longer clear.  Until now, the value of compiling to it was that it
routed you through the "better" of the two implementations.  An
instruction that does nothing different from what invocation to the
direct eval fallback would do does not have obvious value.
2018-03-14 15:17:27 +00:00
dgp 3cda2dc805 merge mark 2018-03-14 05:41:55 +00:00
dgp 0a3e263036 cherry pick the desirable part of the merge. 2018-03-14 05:41:19 +00:00
dgp 864d754a8a backout the latest merge 2018-03-14 04:45:29 +00:00
dgp b16ec6f23b Backout recent patch working on Object and Namespace refcounts.
It creates new leaks and memory corruption according to valgrind,
and the preceding checkin did not.  Keep developing on the memleak branch
and it can merge again when valgrind and memleak tests both like it.
2018-03-14 04:26:41 +00:00
dgp 17e2ed6919 silence compiler warning 2018-03-14 01:31:10 +00:00
dgp 15bfd5756e merge 8.6 2018-03-14 01:30:16 +00:00
dgp 0d0b8e03ed merge 8.5 2018-03-14 00:53:13 +00:00
dgp fd2d896c8f TclTrim must write to *trimRight even when making a quick exit. 2018-03-14 00:45:14 +00:00
dgp f597744c5f Make TclTrim* routines robust against some malformation in inputs.
Better than access violations and panics!
2018-03-14 00:03:59 +00:00
dgp 261fbdac7e A few minor revisions. 2018-03-13 23:56:22 +00:00
pooryorick ec5288cc2e Audit and correct Object reference counting issues. 2018-03-13 20:46:08 +00:00
pooryorick 90f38b1023 Audit and correct Object reference counting issues. 2018-03-13 20:41:23 +00:00
sebres 64eaafad72 remove unexpected panic by TclTrimLeft/TclTrimRight, handling rewritten:
- instead of check the NTS-byte after string (may cause segfault by access violation if out of range),
  it checks now the end-character is well-formed utf8-sequence;
- both work well now on non-NTS strings (without null character at end);
- additionally fixed wrong offsets (trim-length if last char malformed in case of out of range);
new function TclTrim introduced (as combination of TclTrimLeft/TclTrimRight).
2018-03-13 18:52:45 +00:00
dgp 62079a5c69 merge 8.6 2018-03-13 17:14:40 +00:00
dgp 41ed3e0e2b close fork 2018-03-13 16:29:50 +00:00
dgp 9ac074bd09 Fix bugs in msgcat that prevent clean test suite run. 2018-03-13 16:28:43 +00:00
oehhar bbae63cfa9 tip 499 msgcat custom preferences: documentation added 2018-03-13 16:13:02 +00:00
dgp a275b8a5ea Rewrite the [string replace] compiler to take advantage of the richer
set of encoded index values.
2018-03-13 16:03:39 +00:00
oehhar 962427e8cd tip490 oo for msgcat: added documentation 2018-03-13 14:53:16 +00:00
dgp debafda1e7 Repair the INST_STR_REPLACE instruction. 2018-03-13 04:01:03 +00:00
dgp 1af314024c Merge new test and comments from 8.5 to demo that INST_STR_REPLACE is bad. 2018-03-13 03:26:42 +00:00
dgp 23178bb208 Tidy up and comment [string replace] and its corner cases. 2018-03-13 03:15:28 +00:00
dgp 2ae2445072 msgcat 1.7.0 features need foundation of Tcl 8.7. 2018-03-12 15:57:54 +00:00
dgp 8bd4a8cf2c Revert change that broke usage with Tcl 9 2018-03-12 14:41:20 +00:00
dgp 5ff641a603 merge 8.6 2018-03-12 14:17:52 +00:00
dgp 71618ce230 Implement TIP 499: Custom locale search list for msgcat 2018-03-12 14:14:46 +00:00
dgp f35817ce5a Undo setting of execute permissions. 2018-03-12 14:07:26 +00:00
dgp 3af272b07a Implement TIP 490: msgcat for TclOO 2018-03-12 13:58:21 +00:00
dgp 67a242e003 msgcat 1.7 uses [tailcall], so requires Tcl 8.6. 2018-03-12 13:48:35 +00:00
dgp 4ba8623115 Implement TIP 462: Add New [::tcl::process] Ensemble for Subprocess Management 2018-03-12 13:38:46 +00:00
dgp 410bda416e merge 8.7 2018-03-12 13:24:15 +00:00
dgp 861217dbe3 Convert DOS -> unix line endings. 2018-03-12 13:07:50 +00:00
dgp a28f176470 It is confusingly stupid to use variable "length" to hold an actual length
in part of a routine, and hold an end index value later.
2018-03-12 02:48:59 +00:00
dgp 45f5143205 merge 8.6 2018-03-11 21:29:10 +00:00
dgp de9c1aff4a plug memleaks 2018-03-11 21:15:27 +00:00
dgp e7a5b8aaa5 Prevent leaks of the Object structs of oo::object and oo::class. 2018-03-11 21:14:41 +00:00
dgp cd39f34fa5 Attempt at providing the missing instance squelcher. 2018-03-11 18:08:00 +00:00
dgp e7be4a19a0 merge 8.6 2018-03-11 12:22:00 +00:00
dgp a0374a6e61 plug memleak of constructed package requirement. 2018-03-11 12:14:05 +00:00
dgp 3f3c89a947 Screen out empty list value so that assertions are true. 2018-03-11 12:13:11 +00:00
dgp 6b5d0e5d8d merge 8.6 2018-03-10 15:45:00 +00:00
dgp d9dbcf5afb Remove unused argument. 2018-03-10 15:41:04 +00:00
dgp 4dc5255a8e [db36fa5122] Upgrade the index value parsing and encoding machinery. Refactor many systems to make consistent use of it. Repairs many indexing errors in corner cases. 2018-03-10 14:55:14 +00:00
dgp e7a86d967c Use LIST_MAX instead of computing an end index. 2018-03-10 14:44:05 +00:00
dgp 6fce39545c rename tests to make room for new tests in 8.7 2018-03-10 14:37:36 +00:00
dgp 87fd09e44a [db36fa5122] Upgrade the index value parsing and encoding machinery.
Refactor many systems to make consistent use of it. Repairs many indexing
errors in corner cases.
2018-03-09 22:18:30 +00:00
dgp cd4e0ec5de Restore safety for legacy bytecode. 2018-03-09 21:18:19 +00:00
dgp 954522812e Return routine to file scope. 2018-03-09 21:07:12 +00:00
dgp db9b0eccf3 merge 8.6 2018-03-09 20:58:20 +00:00
dgp 06c3fd0c5b Newer utility routine is more suitable. 2018-03-09 20:46:54 +00:00
dgp c13e34da37 Update the command compilers and bytecode execution engine to use new machinery. 2018-03-09 20:34:33 +00:00
dgp a9d546dfbc Use new machinery to repair index value flaws in [lsort]. 2018-03-09 19:40:01 +00:00
dgp 6798b2404f Refactor the index value encode/decode machinery for broader use.
Make use of it to fix index value flaws in [lsearch].
2018-03-09 19:23:42 +00:00
dgp 5fd318bc35 More demonstration tests of index value encoding flaws. 2018-03-09 17:30:30 +00:00
dgp 88812125b1 New tests demonstrating index value encoding flaws in [lsearch]. 2018-03-09 15:28:35 +00:00
dgp 947fb98db5 Stop failing error ordering tests in compiled [lreplace]. 2018-03-08 21:58:30 +00:00
dgp ed53b715ac Another error ordering test. 2018-03-08 19:43:57 +00:00
dgp b8b87e5280 New test expose flaw in error ordering. 2018-03-08 19:28:58 +00:00
dgp 0c5bd7480e Streamline index decoding in INST_LIST_RANGE_IMM execution.
Eliminte the internals intrusion in the unshared in-place operations case.
Tcl_ListObjReplace() really ought to be good enough.
2018-03-08 18:57:16 +00:00
dgp 64038c5656 Rollback the stealth change to [lreplace a 1 1] in Tcl 8.6.6. [409ea17e37].
Scratch rewrite of the [lreplace] compiler.
2018-03-08 17:26:49 +00:00
dgp 101ac8bca7 Reduce the "clever" factor. (Fine line between clever and stupid.) 2018-03-08 02:28:49 +00:00
dgp 30e7e05895 Streamline index decoding in INST_STR_RANGE_IMM execution. 2018-03-07 21:45:12 +00:00
jan.nijtmans b4d6691add Merge 8.6 2018-03-07 21:21:00 +00:00
dgp ce6aa3ea08 When index parsing alone tells you a [string range] is empty, just push it. 2018-03-07 21:02:44 +00:00
jan.nijtmans 3492c92f3d Improve -DTCL_NO_DEPRECATED compiles. It now can handle loading stub-enabled extensions with incompatible magic number (backported from trunk) 2018-03-07 20:24:00 +00:00
dgp d7f41b448c Express INST_LIST_INDEX_IMM index processinig in terms of TCL_INDEX_END so
that consistencies are maintained, and hardcoded values are a bit demystified.
2018-03-07 19:55:23 +00:00
jan.nijtmans 405b9175e6 Fix handling of "pkgIndex" file in "package files" command. This was broken as well, as result of NRE-enabling the "package" command. 2018-03-07 19:35:00 +00:00
dgp 2c44354d13 Establish 4 symbols for categories of parsed index values:
TCL_INDEX_START = 0		The start index.
    TCL_INDEX_END = -2		The "end" index.
    TCL_INDEX_BEFORE = -1	All indices less than start.
    TCL_INDEX_AFTER = INT_MAX	All indices greater than "end".

Then use these symbols among callers of TclGetIndexFromToken() so that
index value parsing can directly implement the callers sense of when
out of range indices ought to be treated the same as start or end positions.
2018-03-07 18:39:44 +00:00
dgp 612199cbe9 Rework TclGetIndexFromToken to make use of TclGetEndOffsetFromObj, and
to lay out the index value encoding cases.
2018-03-07 17:02:50 +00:00
sebres f337281f75 amend to [58716e0e92]: now the duplication is really pointless, so eliminated 2018-03-07 15:10:44 +00:00
dgp 7fe003f8d2 Remove pointless duplication. 2018-03-07 14:16:08 +00:00
dgp f003df5624 Tests of [assemble] use of compiled index values. 2018-03-07 13:40:54 +00:00
dgp 9fb9471807 Incorporate sebres work on the same ticket. Good stuff! 2018-03-07 12:08:40 +00:00
jan.nijtmans 0254080ca0 Fix the "package files" command. Due to the NRE enabling of "package" it always started to return an empty list. 2018-03-06 22:53:00 +00:00
sebres 8c2cbf3211 test cases for "lsort": coverage for "missing from sublist" error case with negative index (-1-1, -2) 2018-03-06 22:27:47 +00:00
sebres c68d043691 try to fix [db36fa5122]: better compiled variants of several indices-related commands, test-cases extended 2018-03-06 21:59:53 +00:00
dgp 720c8de452 rework error handling to keep test suite happy. 2018-03-06 20:59:44 +00:00
dgp 596e89b17d Have assembler use same index value parser as the bytecode compiler. 2018-03-06 20:27:39 +00:00
dgp 847a048c18 New internal routine TclGetEndOffsetFromObj. 2018-03-06 20:09:00 +00:00
dgp da8fbb89c4 various bits of ranting commentary 2018-03-06 17:38:44 +00:00
dgp 0d33258649 merge 8.6 2018-03-06 12:59:23 +00:00
dgp f406561f40 Take the next step in TIPs 330 and 336, ending in 8.7 the USE_INTERP_RESULT and
USE_INTERP_ERRORLINE directives to escape need to migrate to 8.6 interfaces.
2018-03-05 20:00:06 +00:00
sebres 465d28aa75 merge core-8-5-branch (fixes [1873ea0ee4f01b26]: wrong initialization of std-channels ...) 2018-03-05 17:43:42 +00:00
sebres 6c0170972f fixes [1873ea0ee4f01b26]: wrong initialization of std-channels, if no std-handles available at all (e. g. non-console application, like "tk") 2018-03-05 17:37:21 +00:00
dgp 4d47b7f97f TIP 351 Implementation. 2018-03-05 17:07:14 +00:00
jan.nijtmans 0e5d21e88f Re-generate tclTomMath.h. Fix win32 build (due to the use of uint8_t) 2018-03-01 22:27:00 +00:00
jan.nijtmans 0c568099ee Update libtommath to latest "develop" 2018-03-01 20:55:16 +00:00
jan.nijtmans 5753c7a42b Lots of code cleanup, mainly [https://github.com/libtom/libtommath/pull/102|Pull request #102] 2018-03-01 20:43:31 +00:00
dgp 914d6e1546 merge 8.6 2018-03-01 20:13:25 +00:00
dgp 683dada217 Some comments info for the next folks who come wandering in. 2018-03-01 20:07:29 +00:00
dgp 2cd8bf554e Refactor to eliminate duplicate routine parsing tokens as indices. 2018-03-01 16:48:55 +00:00
dgp e9c0312caf We have LLONG_MIN and LLONG_MAX to denote range limits of Tcl_WideInt.
Use them consistently. Also fix a few TIP 484 bugs.
2018-03-01 04:13:15 +00:00
jan.nijtmans 9a809e614a Use mp_isneg() in stead of mp_cmp_d() when the output of this function is simply compared with MP_LT. 2018-02-27 20:48:00 +00:00
jan.nijtmans 0bceead396 No need to set/restore tcl_precision in this test-case 2018-02-27 20:30:00 +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 468041eef8 [8e6a9ac221] Stop false matching with bytearrays. (string-11.55) 2018-02-23 17:00:03 +00:00
dgp 85233a4693 [8e6a9ac221] Stop false matching with bytearrays. (string-11.55) 2018-02-23 16:55:49 +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 455b61dce3 [89dfecb6b7] Make thread IDs in testing commands consistent. 2018-02-22 18:57:20 +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 dda81853f3 Stop seeking out the libieee.a library and linking to it when found.
The latest release of the GNU C library, glibc-2.27 has done away with
the libieee.a library. This prompts a review of why Tcl has been using it.

Since Tcl 8.4.0, Tcl has stopped using the matherr() machinery, so we don't
need it anymore for that.

Since Tcl 8.5.0, Tcl post-processes ERANGE for itself when floating point
underflow or overflow can sensibly produce a 0.0 or Inf result instead of
raising an error. We no longer need to configure the system math library to
silence these reports.

A conseqeunce of this change is that TCL_LIBS will no longer include the
linker option -lieee .  This can potentially change the behavior of programs
that embed libtcl.  If so, though, those same programs are going to also have
behavior changed as the new glibc release gets into routine use. We're doing
those programs a favor by stopping masking the discovery that they need to
be updated.
2018-02-15 15:08:17 +00:00
dgp 0af226b20a merge-mark 2018-02-15 13:52:23 +00:00
pooryorick 919808c6a5 merge pyk-backport-to-8-6
DGP: This checkin creates two memleaks, detected by test compile-12.1

That test leaks the allocations at

    tclOO.c, line 401   AllocObject(...)

    tclOODefineCmds.c, line 8143    Tcl_NewObjectInstance()
2018-02-15 10:52:44 +00:00
pooryorick beff988e79 Rearrange a few lines TclRenameCommand to reduce operations. 2018-02-15 10:23:53 +00:00
pooryorick e8f10bd44e merge pyk-TclOO 2018-02-15 10:14:14 +00:00
pooryorick fa3a1e4638 Udate Tcl_ObjectDeleted to reflect recent changes. 2018-02-15 10:05:27 +00:00
pooryorick 74c5043b5a TclOO: Remove unneeded name manipulation from TclOOCopyObjectCmd. 2018-02-15 09:47:35 +00:00
pooryorick dafcde1702 Fix syntax error in previous commit. 2018-02-15 09:40:40 +00:00
pooryorick e16817b409 Add the check for wrong arguments back to TclOO_Object_Destroy, remove
inadvertant increment of Namespace->refCount.
2018-02-15 09:34:49 +00:00
pooryorick 03a4436237 Streamline TclOO object cleanup routines. 2018-02-15 09:30:29 +00:00
pooryorick e52e074e4f Add TCL_CREATE_NS_IF_UNKNOWN back into Tcl_CreateEnsemble(). 2018-02-15 09:20:50 +00:00
pooryorick 0b5a1c79b7 Fix for [6bca38d59b], TclOO segmentation fault cleaning up objects that that
have mixed themselves into themselves.
2018-02-15 09:10:02 +00:00
pooryorick 0c44c5003d Fix for issue [6cf568a21b]: Tcl_Eval() causes new segfault (TclOO object
creation by qualified name).
2018-02-15 08:53:15 +00:00
pooryorick 2b9b50b436 Minor refactoring of TclOO object reference count booking during object
creation.
2018-02-15 08:38:27 +00:00
pooryorick 80fc86a116 Eliminate some duplicate code in tclOO.c/Tcl_NewObjectInstance(). 2018-02-15 06:45:34 +00:00
pooryorick 1da12398f2 Streamline TclOO object cleanup routines. 2018-02-15 06:35:02 +00:00
pooryorick 4322dab97e merge pyk-command-named-colon 2018-02-15 06:01:09 +00:00
pooryorick 3243dfedd1 Move return type to its own line. 2018-02-15 05:11:15 +00:00
pooryorick fa5058cbca merge (cherrypick): Add missing parenthesis to an expression in TclEnsureNamespace. 2018-02-15 04:56:48 +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
pooryorick ade95255b9 Fix segmentation fault in TclOO that was noted in [16fe1b5807]. Update
coroutine and TclOO object creation routines to use TclCreateObjCommandInNs.
2018-02-14 21:47:57 +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
pooryorick e6dd74e90e Lift the restriction on command names names that begin with ":". 2018-02-14 19:07:16 +00:00
pooryorick cf4de002dc New empty branch for other branches that bring changes from core-8-branch back
to core-8-6-branch.
2018-02-14 19:07:14 +00:00
dgp c64afc94f1 merge 8.7 2018-02-14 15:33:29 +00:00
dgp 55898c44b9 Fix regression in [expr {0%$bignum}]. 2018-02-14 14:38:15 +00:00
pooryorick b9b319fad2 merge pyk-backport-to-8-6 2018-02-14 14:19:31 +00:00
pooryorick 5d5bd4cd55 Modify TclCreateProc to handle arbitrary argument names, not just ASCII. 2018-02-14 14:05:04 +00:00
pooryorick 1e854210b7 Rewrite documentation in comments for brevity and clarity. 2018-02-14 13:37:27 +00:00
pooryorick 7d25e385a2 Modify test oo-11.6 to not use [self], which is not avaiable until 8.7. 2018-02-14 13:00:28 +00:00
dgp c329006b1a More tests for bignum modulus regressions 2018-02-14 12:52:35 +00:00
dgp 40e9ab2e65 More tests for bignum modules regressions. 2018-02-14 12:52:06 +00:00
dgp dc74da2f56 merge-mark 2018-02-14 12:50:22 +00:00
pooryorick c6eb0cc51d Unit test for issue 3c32a3f8bd, Segmentation fault in
TclOO.c/ReleaseClassContents() for a class mixed into one of its instances.
2018-02-14 12:31:33 +00:00
pooryorick a7c17bc224 Fix bug 3c32a3f8bd, segmentation fault in TclOO.c/ReleaseClassContents()
for a class mixed into one of its instances.
2018-02-14 12:14:38 +00:00
pooryorick 2606a3a7db Fix for issue 9fd5c629c1, TclOO - aborts when a trace on command deletion
deletes the object's namespace.
2018-02-14 10:57:38 +00:00
pooryorick ea6e8c9dcd Fix for issue 9fd5c629c1, TclOO - aborts when a trace on command deletion
deletes the object's namespace.
2018-02-14 10:46:08 +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 396c1a637c New test expr-32.7 for bignum modulus range. 2018-02-13 20:51:57 +00:00
pooryorick 1553090bc3 Add remaining wrapper to the NR functions, remaining calls to
TCL_NRAddCallback, and a test for a package require script that yields.

DGP: This checkin introduces a memleak, detected by test compExpr-7.1.
2018-02-12 12:40:34 +00:00
pooryorick f4babdb0ac 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-02-12 10:44:44 +00:00
pooryorick 4c79bcbe64 Preparation to provide TclNRPackageObjectCmd: Eliminate the loop in
PkgRequireCore so that TclNRAddCallback can be added at the needed spots.
2018-02-12 10:14:02 +00:00
pooryorick 568724e468 Change the signature of PkgRequireCore in preparation to provide
TclNRPackageObjCmd.
2018-02-11 19:35:27 +00:00
pooryorick ad022e6d3b Remove restriction on defining the class of a TclOO object not explicitly
instantiated from ::oo::class.
2018-02-11 19:29:08 +00:00
pooryorick 5765c1e392 Refine documentation for Tcl_NR* functions. 2018-02-11 19:19:46 +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
sebres 4f65558ad0 win/nmakehlp.c: removed unneeded dependencies to shlwapi (the same is easily implemented by standard win-api) 2018-02-08 14:02:15 +00:00
oehhar ffae8c82da Do not allow prefixed subcommands for mcutil 2018-02-08 12:45:50 +00:00
oehhar 4cff9271ac Add subcommand mcpreferences to export getpreferences and getsystemlocale functions 2018-02-08 09:49:28 +00:00
oehhar 3f2c5cd5aa TIP 499: Custom locale search for msgcat 2018-02-07 19:25:30 +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
José Ignacio Marín b618278c9f Update TZ info to tzdata2018c. 2018-02-02 09:19:41 +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
apnadkarni adf9cf5543 Fixed def for INCLUDE_INSTALL_DIR when building against Tcl source. Bumped to 1.2. 2018-02-02 06:07:26 +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
dgp a0c6bf8d92 Regression test for shimmering danger in [join]. 2018-01-27 01:38:21 +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 46e8af13b6 Dup test name 2018-01-25 22:11:34 +00:00
dgp b0fce7a700 merge 8.7 2018-01-25 21:58:51 +00:00
dgp d20d1e603b test suite debugging 2018-01-25 21:35:01 +00:00
dgp 19c0142741 lifetime management of files generated by tests 2018-01-25 21:28:41 +00:00
dgp 189d0a83d2 lifetime management of files generated by tests 2018-01-25 21:15:36 +00:00
dgp aa4c401952 test name continuity 2018-01-25 20:41:26 +00:00
dgp f08ea44564 Dup test names 2018-01-25 20:28:15 +00:00
pspjuth 83df36ac41 Allow -stride 1. 2018-01-25 20:05:54 +00:00
dgp eb9e2858c1 merge 8.7 2018-01-25 16:51:29 +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 e403ff8f45 Documentation fix: there is no "O" conversion, just "o" for octal. Also, "b" conversions normally don't produce a sign. 2018-01-24 09:59:15 +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 69868ee129 merge core-8-branch. Now tested as well with new nmake system. 2018-01-20 14:36:36 +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 5fea88381c typo's (found by Gustaf Neumann). Thanks! 2018-01-17 10:06:30 +00:00
oehhar 7c60d44ce6 Comment updated 2018-01-16 14:53:41 +00:00
oehhar e89d1e331e Solve case where msgcat is called within a class definition script (works only for 8.7) 2018-01-16 14:13:14 +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
oehhar e841295386 Install msgcat 1.7 in library folder 8.6 instead 8.5. It uses tailcall and will not work with 8.5 2018-01-13 17:17:39 +00:00
oehhar 87c12599bf Test numbering and naming corrected 2018-01-13 17:14:22 +00:00
oehhar eaacc9bb56 Changed msgcat version from 1.6.2 to 1.7.0 -> this is not a patch release 2018-01-13 16:44:38 +00:00
oehhar ecaec63f48 Extended command msgcat::mcexists by switch "-namespace ns" to explicitly specify namespace 2018-01-13 15:23:38 +00:00
jan.nijtmans f0b9b9fbb6 merge core-8-branch 2018-01-12 16:30:03 +00:00
oehhar e1ffd3f005 Implement the "mcn" command as "mc" with explicit namespace. 2018-01-12 14:52:25 +00:00
oehhar 2cfe8bb561 Use the test "[namespace which self] ne "::oo::Helpers::self"" to check if we are within an object (undocumented test proposed by dkf on clt 2018-01-12 2018-01-12 14:13:03 +00:00
oehhar e9f2695255 replace "return [uplevel 1 [list [namespace origin ..." by tailcall 2018-01-12 14:03:04 +00:00
oehhar 1fda13591a Corrected test cleanups 2018-01-11 16:46:09 +00:00
jan.nijtmans 244885a03e merge core-8-6-branch 2018-01-11 15:45:20 +00:00
jan.nijtmans 45e646472d Fix behavior of Tcl_GetRange() and "string range" regarding surrogates, when Tcl is compiled with -DTCL_UTF_MAX=4. Partial fix for bug [11ae2be95dac9417]. Also, fix typo. 2018-01-11 15:44:05 +00:00
oehhar 3b5858bcd2 TIP490: oo for msgcal: new solution enable any command for oo, new command mcpackagenamespacege 2018-01-10 23:17:43 +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
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
pspjuth fc03549d34 Doc for lsearch -stride 2018-01-02 23:05:25 +00:00
pspjuth 54590627ee Add -stride to lsearch. TIP#351 2018-01-02 22:03:02 +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 603e23c2a9 merge core-8-branch 2017-12-15 16:08:14 +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 3f03f8189e Oops, couldn't build tclWinPanic.o. Fixed now. 2017-12-15 13:04:15 +00:00
jan.nijtmans c576cbec93 merge core-8-branch. Fully functioning now, including with the new vc-reform implementation. 2017-12-15 12:55:59 +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 a69614b432 merge 8.7 2017-12-06 12:24:26 +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 14c8dabffe merge (cherrypick): Add missing parenthesis to an expression in TclEnsureNamespace. 2017-11-25 21:40:19 +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
pooryorick 9b1ecce298 Move return type to its own line. 2017-11-23 18:24:09 +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
pooryorick 75924256c1 Fix segmentation fault in TclOO that was noted in [16fe1b5807]. Update
coroutine and TclOO object creation routines to use TclCreateObjCommandInNs.
2017-11-19 00:06:51 +00:00
pooryorick 42c80667fd Lift the restriction on command names names that begin with ":". 2017-11-17 23:42:16 +00:00
pooryorick 3c942c50d9 Fix [16fe1b5807]: namespace ensemble command named ":" is mistakenly given the
empty string as its name.
2017-11-17 22:30:06 +00:00
jan.nijtmans 48047bb120 merge core-8-6-branch 2017-11-17 15:30:02 +00:00
jan.nijtmans 28017c14e3 TIP #422, Tcl 8.7 part: Mark all *VA functions as deprecated. They will be removed in Tcl 9.0. 2017-11-17 10:23:14 +00:00
jan.nijtmans 5ff5853a6e merge core-8-6-branch 2017-11-16 08:45:54 +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
jan.nijtmans 346cce5745 Remove compat/float.h and related machinery. The last system known where this was needed was SunOS-4, which is not supported by Tcl any more for a long ... long time ....
Also, fix a typo in generic/tclInt.h and remove some end-of-line spacing.
2017-11-15 09:42:07 +00:00
jan.nijtmans e3439b6af2 Change signature of (internal) TclScanElement() function. This saves memory allocation and the possibility for panic's in dict and list handling, requiring 1/4 of memory for internal allocation of temporary storage. No change to external API. 2017-11-15 08:55:18 +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
dgp 9f65735813 Repair lost of broken [package prefer] testing. 2017-11-14 17:09:49 +00:00
dgp 2ea108ae28 [5d6de65036] [package require] with [package prefer stable] was not choosing available stable package. 2017-11-14 14:48:21 +00:00
jan.nijtmans eb2a9484b8 Merge core-8-6-branch 2017-11-13 11:15:44 +00:00
jan.nijtmans 01fd6594cf Add a lot of "deprecation" marks to internal API which will be removed in Tcl 9.0 (see also tcl-9-cleanup branch). Extensions still using this API will get a compiler warning, but everything will continue to work fine for all future 8.x releases. 2017-11-13 08:37:55 +00:00
jan.nijtmans 752cfbe04c merge core-8-6-branch 2017-11-10 08:49:54 +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 78374f18a4 merge core-8-6-branch 2017-11-09 12:50:43 +00:00
jan.nijtmans c59b3f3bc1 For alpha/beta versions of Tcl, stub-enabled extensions are only allowed to run on the EXACT the same Tcl versions as compiled: The stubs might still be in flux, they are not guaranteed to work on future Tcl versions anyway.
Backported from "novem" (which already had this special protection). For final releases (8.7.0) everything works as before.
2017-11-09 12:37:20 +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
jan.nijtmans 12d3a7d307 Change "epoch" field for dicts from "int" to "unsigned int". This doubles the number of available epoch's before overflow. Also make 0 the special value in stead of -1, meaning "dict search done". That also means that epoch counting starts with 1. 2017-11-08 09:37:31 +00:00
dgp e82d7fb753 compiler warning 2017-11-08 03:02:22 +00:00
dgp 5188d1d927 compiler warning 2017-11-08 02:57:58 +00:00
dgp 3b989eefe0 merge 8.7 2017-11-08 02:48:47 +00:00
dgp a2d6ec1119 merge 8.6 2017-11-08 02:26:07 +00:00
dgp 2ba5fab30e Modify TclCreateProc to handle arbitrary argument names, not just ASCII. 2017-11-08 02:25:40 +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 2ad54a6f6e merge 8.7 2017-11-07 15:11:43 +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 d0665d7a12 merge core-8-6-branch 2017-11-07 13:29:28 +00:00
jan.nijtmans 45808db8dc TIP #422 implementation, Tcl 8.7 part. 2017-11-07 09:08:48 +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
jan.nijtmans c06751fdf8 Fix version number of Windows Help file (not sure if it's actually used, but better safe than sorry) 2017-11-06 14:46:49 +00:00
pooryorick 9b30058284 Rewrite documentation in comments for brevity and clarity. 2017-11-06 01:33:57 +00:00
f.bonnet 6fff25ecbc Fixed stupid Tcl_DecrRefCount bug in TclCleanupChildren with normally terminated processes. 2017-11-05 16:41:11 +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
jan.nijtmans ded2a79966 update .project file with branch name. Make clear that optparse doesnt work with 8.4 any more 2017-11-05 14:14:23 +00:00
dkf d52223f024 [0d902eadd6] Ensure that [string first] handles ASCII in Unicode correctly. 2017-11-04 00:45:27 +00:00
dkf 4030616bbf [0d902eadd6] Ensure that [string first] handles ASCII in Unicode correctly. 2017-11-04 00:44:14 +00:00
dkf b55d5cc57e Fix for the weird [string first] behaviour. 2017-11-04 00:34:48 +00:00
dkf e4356f7d64 Detected bug in [string first] with unicode. Pat Thoyts found it. 2017-11-04 00:25:43 +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
dgp 0480b5d79b Revise a few stray packages not yet ready to tolerate a Tcl 9 bump. 2017-11-03 17:02:49 +00:00
dgp 10a9305777 TIP 345 Implementation. 2017-11-03 16:48:44 +00:00
jan.nijtmans d8596e5583 merge core-8-6-branch 2017-11-03 12:59:07 +00:00
jan.nijtmans 735d38cd7c merge trunk 2017-11-03 12:24:06 +00:00
jan.nijtmans 785f1059e4 merge core-8-6-branch 2017-11-03 12:15:08 +00:00
pooryorick d33ee7bc07 Unit test for issue 3c32a3f8bd, Segmentation fault in
TclOO.c/ReleaseClassContents() for a class mixed into one of its instances.
2017-11-01 22:21:50 +00:00
pooryorick 8bb421f959 Fix bug 3c32a3f8bd, segmentation fault in TclOO.c/ReleaseClassContents()
for a class mixed into one of its instances.
2017-11-01 21:05:32 +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 2ff3ecb534 merge trunk 2017-10-30 12:02:48 +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
pooryorick e0578530b0 merge bug-fc1409fc91. 2017-10-30 05:25:19 +00:00
pooryorick a79bc3c8ce Fix for issue 9fd5c629c1, TclOO - aborts when a trace on command deletion
deletes the object's namespace.
2017-10-30 05:19:55 +00:00
dgp 30c40c4540 merge 8.6 2017-10-30 03:23:59 +00:00
dgp c8342af338 merge 8.6 2017-10-30 03:01:46 +00:00
dgp bed6e18d15 merge trunk 2017-10-27 13:12:09 +00:00
dgp fcc5b3486f merge trunk 2017-10-27 13:07:10 +00:00
dgp c668ed46ec oops 2017-10-27 12:57:45 +00:00
dgp 261012ce98 Update tests that were still written on the outdated premise that Tcl's encoding subsystem had to initialize starting in the identity encoding. 2017-10-27 12:51:14 +00:00
dgp 3888c4fda4 merge mark 2017-10-27 12:04:53 +00:00
jan.nijtmans fa2e7e8949 Fix timeout calculation in epoll-based notifier. Proposed fix for [1a6a36d901dedead248ea96df09d5dc159532652|1a6a36d901]. Patch by Lucio Andrés Illanes Albornoz. Thanks! 2017-10-27 07:26:15 +00:00
dgp 053a74e0fa Create new testing command [teststringbytes] to probe the things that
otherwise require [encoding convertto identity]. adapt encoding-15.3 to use.
2017-10-26 02:08:27 +00:00
dgp 30c6827ee1 Convert remaining tests to use [testbytestring].
encoding-15.3 still needs replacement for [encoding convertto identity].
That is, some testing command to expose objPtr->bytes.
2017-10-25 02:54:24 +00:00
dgp eb2cfa3e6f Repair Tcl_CreateEncoding(); Modernize [testencoding];
Update most tests toying with identity encoding.
2017-10-25 02:23:12 +00:00
dgp 40d9b81e23 Stop using "identity" as an encoding to test basic functionng of the
[encoding] command. "iso8859-1" is another one always available.
2017-10-24 23:30:35 +00:00
dgp 1552384787 Extend Tcl_CreateEncoding() to be able to create an encoding without
registering it when it has no name.  Then use this to create "identity"
encoding without naming it "identity". Then no one can look it up by that name.
2017-10-24 23:16:23 +00:00
jan.nijtmans 16976013d1 merge trunk 2017-10-24 13:59:40 +00:00
jan.nijtmans ef7ea2c390 merge trunk 2017-10-24 13:59:13 +00:00
jan.nijtmans d5f679a3f6 Change (internal) refCount field from TclRegexp to type size_t: this allows more references on 64-bit platforms. Remove unused macro "xxx" in regguts.h. Remove superflouous eol-space in oo.test. 2017-10-24 13:56:26 +00:00
Kevin B Kenny e532a0de84 Historical change affecting tests: Detroit did not observe Daylight Saving Time in 1967 2017-10-24 13:32:54 +00:00
dkf 634213a9c8 [fc1409fc91] Method cloning needs to be careful with body representations. 2017-10-24 11:25:29 +00:00
dkf 8e537759cf Added test case. 2017-10-24 11:23:54 +00:00
pooryorick fada619052 [fc1409fc91]: TclOO method with non-literal value for body argument causes segmentation fault 2017-10-24 08:38:17 +00:00
dgp 319b71965b backout initial commit; need more care.
Binary writes internally make use of this encoding.  Need to hide it
instead of destroy it.
2017-10-23 17:58:07 +00:00
José Ignacio Marín 47a0727695 Update TZ info to tzcode2017c. 2017-10-23 17:10:19 +00:00
dgp 45d0977a5c Implementation branch for TIP 345: Kill the "identity" encoding.
This checkin, completely does that.  Bad news is it causes huge failures.
We're still making a lot of use of this encoding, and cannot complete
this TIP until the branch is repaired.
2017-10-23 17:06:57 +00:00
dgp 172896b15a Implementation branch for TIP 114 - Eliminate Octal Parsing... 2017-10-23 16:20:18 +00:00
jan.nijtmans 5470f13299 tclWinPanic.c is in the \win directory, not in \generic! 2017-10-23 13:47:57 +00:00
jan.nijtmans c0effc5b46 merge trunk 2017-10-23 13:23:08 +00:00
jan.nijtmans e9b584f81b merge core-8-6-branch 2017-10-23 12:10:42 +00:00
dkf 56d6e9480f [1a56550e96] Ensure that method list introspection finds methods from mixins in all cases. 2017-10-19 09:30:16 +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
dgp 8a910c1a53 Plug some memleaks. 2017-10-13 16:15:52 +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
jan.nijtmans e7582d10c6 Eliminate variable which is only used once. And a minor end-of-line space reduction. No functional change. 2017-10-12 15:20:42 +00:00
jan.nijtmans 5064777d16 merge core-8-6-branch 2017-10-09 14:27:31 +00:00
jan.nijtmans c925a86988 Merge core-8-6-branch 2017-10-09 12:54:39 +00:00
jan.nijtmans fd6a064ee7 Merge latest 'const'ification changes from libtommath (develop branch, will be in next release). None of those are used in Tcl. 2017-10-03 09:11:05 +00:00
jan.nijtmans 6881a1a274 'const'ify all libtommath functions, will appear in next libtommath version. See: pull request [https://github.com/libtom/libtommath/pull/88|88] 2017-10-02 15:22:27 +00:00
jan.nijtmans b0fe49c36d Make libtommath's "make" work in Tcl environment (for testing). Eliminate internal s_is_power_of_two(), which can better be done inline. Fix tommath.h for _MSC_VER. 2017-09-22 08:48:23 +00:00
apnadkarni a52f0db3e4 Merged core-8-6-branch to pick up 32/64-bit DLL mismatch error message.
Actually already cherrypicked but redoing because that does not show
up on timeline and a full merge recommended on the chat.
2017-09-22 02:17:02 +00:00
apnadkarni 4bf8f43b3a RFE [566a999189] - better error message for 32/64 bit mismatch on load. 2017-09-21 19:05:11 +00:00
jan.nijtmans 1b28405773 Move fast return from s_is_power_of_two() to mp_div_d(). This saves a function call in the common case where b is not a power of 2. 2017-09-20 09:21:54 +00:00
jan.nijtmans 65703d1f87 Further astyle formatting of libtommath. No functional changes. 2017-09-20 09:07:35 +00:00
jan.nijtmans 943b46881e Merge trunk 2017-09-18 15:13:40 +00:00
jan.nijtmans f75f76c9d4 Finish libtommath's constification work. All done (hopefully). And make sure that C preprocessor directives have the '#' as first character on the line. 2017-09-18 14:38:26 +00:00
jan.nijtmans f5ea63343e Another round of libtommath const'ification. To be submitted to the libtommath folks 2017-09-18 12:53:48 +00:00
jan.nijtmans a708ae2da2 Merge libtommath upstream changes (astyle formatting only). No functional changes. All Tcl-specific modifications are kept. 2017-09-18 08:31:55 +00:00
jan.nijtmans d4e73bcab5 re-format everything through astyle. Taken from libtom/libtommath (pull request [https://github.com/libtom/libtommath/pull/85|85]) 2017-09-15 14:44:00 +00:00
jan.nijtmans 8f339500a2 'const'ify more libtommath functions. All functions in generic/tclTomMath.decls (used by Tcl) are done now. 2017-09-15 13:08:31 +00:00
dgp bf01a303da Move new declarations to more conventional place for tidier merging. 2017-09-14 14:02:12 +00:00
jan.nijtmans 99d940211c Remove some unnecessary #if 0 sections. Fix comments and panic messages. No functional changes. 2017-09-14 08:05:32 +00:00
jan.nijtmans 7b8b406719 Fix [f5da3d30e096a1c3486fbc480a6ece01fcb277a6|f5da3d30e0]: clerical error in comments 2017-09-14 07:42:38 +00:00
jan.nijtmans c659b044b1 Make mp_get_long and mp_set_long available to tommath-enabled Tcl extensions. Deprecate the internal TclBNInitBignumFrom* functions, in favor of the official tommath functions with the same purpose. 2017-09-13 10:14:31 +00:00
jan.nijtmans 3e55dbb18c Many 'const' addtions in libtommath where it makes sense. To be submitted back to the libtommath guys. 2017-09-11 10:38:07 +00:00
jan.nijtmans b2446d8d41 Add some more functions from libtommath for availability within Tcl (mainly the 'long long' variants). Add more 'const' keywords there too. 2017-09-08 14:15:13 +00:00
gahr e86e8a501d Be consistent about how I am referred to. 2017-09-08 13:30:29 +00:00
dgp d03a4dcc88 Bump to 8.7a2 to distinguish trunk from 8.7a1 release. 2017-09-08 13:13:15 +00:00
dgp 4ce5b276eb merge release 2017-09-08 12:50:06 +00:00
jan.nijtmans 757012c289 Rebase to trunk 2017-09-08 12:48:35 +00:00
jan.nijtmans 15f27ca8f2 Rebase to trunk 2017-09-08 11:04:34 +00:00
dgp 877e9d6b11 merge trunk; rc1 2017-09-07 12:59:14 +00:00
jan.nijtmans 413fe66650 Fix use of "long long" (manually) in MSVC 2017-09-06 15:02:24 +00:00
dgp ca70072a99 update changes 2017-09-05 15:38:02 +00:00
dgp d9f2bf1d17 merge trunk 2017-09-05 12:41:10 +00:00
jan.nijtmans c2846c0f5c Merge core-8-6-branch to trunk, especially the 1.6.0 -> 1.6.1 renumbering from msgcat 2017-09-04 14:01:45 +00:00
jan.nijtmans b74f59a5b4 merge core-8-6-branch 2017-09-04 12:38:14 +00:00
dgp a3dfc55957 [0e4d88b650] Allow command overwrite when deletion callback deletes namespace. 2017-09-02 22:10:59 +00:00
jan.nijtmans 4b9e6d92be Merge core-8-6-branch 2017-09-01 13:49:55 +00:00
dgp 4ce83fdb43 merge trunk 2017-09-01 01:44:09 +00:00
jan.nijtmans ce32fdecb2 Ignore libtommath/doc directory. Add some VS-related makefiles, useful for testing 2017-08-31 15:07:57 +00:00
jan.nijtmans 105a61c09b Merge core-8-6-branch. Remove all git tag information for libtommath, so we don't have useless file differences with every libtommath release. 2017-08-31 13:56:30 +00:00
jan.nijtmans 432e75210f Undo tag removal (just get libtommath directly from GitHUB), so we don't have useless file changes with every new release 2017-08-31 13:32:52 +00:00
jan.nijtmans 595e613479 (merge-mark core-8-6-branch).
Give state to UtfToUtfProc() and UnicodeToUtfProc() in which the last (intermediate) Tcl_UniChar can be remembered: This way those functions can produce 4-byte UTF-8 sequences built from surrogate pairs if Tcl is compiled with TCL_UTF_MAX=4. For TCL_UTF_MAX=3 and TCL_UTF_MAX=6 this has no effect.
2017-08-31 12:21:43 +00:00
oehhar c0e413055e http state 100 continue handling broken [2a94652ee1] 2017-08-31 09:35:52 +00:00
andy 7aafa756ac Cherrypick string.test [de104ef5ab] 2017-08-30 15:29:16 +00:00
jan.nijtmans 6d8b0c705f Tweak libtommath building, such that it doesn't depend on uint64_t any more. (handle mp_word in the same way as mp_digit) 2017-08-30 12:37:50 +00:00
jan.nijtmans faaf0a0fe6 Adapt libtommath's "changes.txt", and other text-files. Adapt bn_mp_read_radix.c to latest libtommaths 'tcl-fixes' commit (harmless for Tcl). 2017-08-30 11:46:33 +00:00
jan.nijtmans 07bcf919d6 Cherry-pick [https://github.com/libtom/libtommath/commit/a0a86c696a7182f8be4b10bb79a1c5c971dc9561]: Merge branch 'tcl-fixes' into develop
Remove many files, which are not used in Tcl.
Modify "changelog.txt", with real release-date of 1.0.1 version
2017-08-30 11:20:19 +00:00
jan.nijtmans f70c0ac860 a few missing bits after previous commit 2017-08-29 21:27:56 +00:00
jan.nijtmans 97d25d7902 Forgot a few files from libtommath 1.0.1 2017-08-29 21:16:54 +00:00
jan.nijtmans c3d5808cdd upgrade to libtommath 1.0.1 (With all Tcl-specific changes - as far as needed - intact) 2017-08-29 20:45:34 +00:00
jan.nijtmans 187a67149b Merge libtommath 1.0.1 final 2017-08-29 20:43:48 +00:00
jan.nijtmans 2d65cb7514 libtommath 1.0.1 2017-08-29 20:39:15 +00:00
jan.nijtmans 92a05930af libtommath 1.0.1 rc2, for test purposes only 2017-08-29 20:25:53 +00:00
jan.nijtmans 1ef0babc38 Fix eol-style (fossil warning: mixed line endings) 2017-08-29 19:55:52 +00:00
jan.nijtmans 92265d56a3 libtommath 1.0.1 rc 2 2017-08-29 19:52:35 +00:00
jan.nijtmans 4264a4f6ab merge-mark 2017-08-29 09:25:17 +00:00
f.bonnet 0a8718312d Comments and formatting 2017-08-27 21:25:14 +00:00
f.bonnet 68b53cfb25 Fixed reference counting issue with objects returned by WaitProcessStatus 2017-08-27 15:25:57 +00:00
f.bonnet 935e991786 On Windows, Tcl_Pids now map to dwProcessId instead of hProcess because the system reuses handles of recently terminated processes. 2017-08-27 15:24:22 +00:00
f.bonnet 43c89a019c Refactoring to support all processes and not just detached ones. 2017-08-27 11:05:45 +00:00
ferrieux 2e9194366a Fix [b50fb214] : add to 2>> the same O_APPEND that was added to >> back in 2005. 2017-08-24 16:56:51 +00:00
f.bonnet 57aa77515a Added switches and pid list support to tcl::process status 2017-08-23 19:51:02 +00:00
f.bonnet 8dd2373a08 Refactoring and preliminary implementation of tcl::process (list|status) 2017-08-23 18:31:56 +00:00
jan.nijtmans ce72664606 merge core-8-6-branch 2017-08-22 12:41:18 +00:00
jan.nijtmans 0eb18d8f91 merge core-8-6-branch 2017-08-18 22:06:54 +00:00
f.bonnet 03470df2ff Completed [tcl::process autopurge] semantics and added [tcl::process purge] implementation along with the necessary internal functions TclpGetChildPid/TclReapPids 2017-08-18 12:49:08 +00:00
f.bonnet 5aaef06572 Added [tcl::process autopurge] flag management with TclProcessGetAutopurge/TclProcessSetAutopurge companion functions. 2017-08-18 07:51:01 +00:00
jan.nijtmans e6336bb806 Merge core-8-6-branch. Update outdated comment (cherry-pick [d5dec2b0514639f44929cbbba9c4130798a8a54a|d5dec2b051]) 2017-08-17 22:50:16 +00:00
jan.nijtmans 922d8a71a5 merge core-8-6-branch 2017-08-17 21:56:51 +00:00
f.bonnet 0b8e964f45 Fixed line endings 2017-08-17 13:03:48 +00:00
f.bonnet c86a23de04 Basic scaffolding for tcl::process 2017-08-17 13:02:27 +00:00
andy 89ce4defb5 Correct longstanding typo in continue man page 2017-08-12 19:45:04 +00:00
dgp ad9bc7297d Add 8.7 -only changes to the changes file. 2017-08-10 19:14:15 +00:00
dgp 0079285837 Update outdated comment. 2017-08-10 17:34:31 +00:00
dgp aedd652645 Bring changes up to the 8.6.7 release. 2017-08-10 14:56:23 +00:00
dgp 4056a4dc4b Release candidate branch for Tcl 8.7a1. 2017-08-10 14:29:11 +00:00
dgp ffaeeeddaa merge 8.6 2017-08-10 14:17:01 +00:00
dgp 587206a660 merge mark 2017-08-09 16:38:35 +00:00
andy 664774bec4 [5bfe3de008]: Modify [source] to set input EOF character but not output EOF character. This avoids having ^Z being appended to the sourced file when it is an always-writable [tcl::chan::variable] in a custom VFS. Tested by adding this same change as a patch to Tcl 8.6.6 in KitCreator because that seems to be the easiest way to get custom VFS capability exposed as script commands. Original problem introduced by [03cdfc3a86] 2000-05-11 00:16:52. 2017-08-07 01:16:39 +00:00
dgp 3cf11a1ce9 merge 8.6 2017-08-04 13:18:37 +00:00
jan.nijtmans bb331bf1d8 merge core-8-6-branch 2017-07-17 08:04:57 +00:00
jan.nijtmans 9dd9b629b3 merge core-8-6-branch 2017-07-13 15:07:39 +00:00
dgp 457f43e25b merge 8.6 2017-07-06 16:40:38 +00:00
jan.nijtmans af0816e0ca merge core-8-6-branch 2017-07-03 12:45:44 +00:00
jan.nijtmans 58dd15c51d merge core-8-6-branch 2017-07-03 08:30:43 +00:00
jan.nijtmans ca0b2a012e merge trunk 2017-06-29 13:18:33 +00:00
jan.nijtmans a646f081bc merge core-8-6-branch 2017-06-28 13:44:23 +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
dgp 45cf14ed03 Merge 8.6; Bump to TclOO 1.2.0. 2017-06-26 20:00:35 +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 2bd7095b87 No longer split tests for longIs32bit/longIs64bit, since the results should be identical 2017-06-23 15:04:44 +00:00
dgp 400f9d27f5 typo fix 2017-06-23 13:11:37 +00:00
dgp 5d68b7ef56 Rewrite the documentation of [regsub -command] so it's not quite such a mess. 2017-06-23 13:09:23 +00:00
dgp ba387de8cd repair broken tests 2017-06-23 12:39:13 +00:00
dgp 70d12096d5 Repair compiler warning about uninitialized value. 2017-06-23 12:28:57 +00:00
jan.nijtmans 3dedad17ed TIP #472 implementation: Add Support for 0d Radix Prefix to Integer Literals 2017-06-23 08:11:42 +00:00
dkf a9c238476a Add [regsub -command] case that wasn't actively tested for. 2017-06-22 22:54:32 +00:00
dkf cfafc391f2 Implement TIP #473: Allow a Defined Target Namespace in oo::copy 2017-06-22 22:03:06 +00:00
dkf 440f85800c Implement TIP #470: Reliable Access to OO Definition Context Object 2017-06-22 21:50:08 +00:00
dkf 2a11adb848 merge trunk 2017-06-22 21:48:48 +00:00
dkf 77f95f38bf Implement TIP #463: Command-Driven Substitutions for regsub 2017-06-22 21:46:40 +00:00
dgp 2710235273 merge trunk 2017-06-22 12:25:35 +00:00
jan.nijtmans 042e99227a merge core-8-6-branch 2017-06-22 08:59:59 +00:00
jan.nijtmans 6454bee19b Merge core-8-6-branch 2017-06-22 08:16:41 +00:00
dkf 20b4459b9d Factor out chunk of non-obvious code in the guts of [oo::define] into one place. 2017-06-18 18:02:34 +00:00
dgp 73f548527a Another reworking, now with comments. 2017-06-16 19:54:57 +00:00
dgp 3923106cf7 Simplify the final loop when we know we're generating strings for all. 2017-06-16 16:23:22 +00:00
dgp 17711009b6 Split loop into two cases for further simplification. 2017-06-16 16:07:48 +00:00
dgp b3bda726c1 Factor out and simplify loop scanning leading known empty values. 2017-06-16 15:51:12 +00:00
dgp e1b4ae0798 Use local variables. 2017-06-16 14:46:56 +00:00
dgp aca86a46ff Rework the logic. Equivalent function. 2017-06-16 14:43:16 +00:00
dgp 9ddb31d522 Extend cases where string rep generation can be prevented. 2017-06-16 12:56:03 +00:00
dgp 6123ba004c Better define the meaning of "first" and "last". 2017-06-16 11:47:46 +00:00
jan.nijtmans 56ea73145f Merge core-8-6-branch.
Fix gcc warning: tclStrToD.c:1180:2: warning: enumeration value ‘ZERO_D’ not handled in switch [-Wswitch]
  switch (acceptState) {
2017-06-15 11:01:58 +00:00
jan.nijtmans bc4db4d40e merge core-8-6-branch 2017-06-15 09:38:09 +00:00
dkf 2cdd3134ab [9c058c5803e30d02] Correction to cross linking in dict(n)'s SEE ALSO section. 2017-06-14 21:51:36 +00:00
dkf d453cdacec [f2336c116b] Move pragmas to make gcc happy; it is pickier than clang. 2017-06-14 21:42:38 +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 e8d9fe8ebe Rebase to core-8-6-branch (who told that fossil doesn't know how to rebase ....) 2017-06-14 07:54:51 +00:00
dkf ad34457a54 Add tests and docs. 2017-06-13 11:10:11 +00:00
griffin 2712a556fb Add support of 0d in the format %# conversion flag. Add tests for same. 2017-06-12 14:04:29 +00:00
jan.nijtmans 8c62a9c228 merge trunk 2017-06-12 13:29:40 +00:00
dgp 3f2eb64de8 Another TclStringCatObjv optimization to delay/avoid string rep generation. 2017-06-08 21:15:25 +00:00
dgp 4b81f6ff43 Don't test the impossible. 2017-06-08 21:10:01 +00:00
dgp cc72d116bd Modernize overflow checks. 2017-06-08 21:05:22 +00:00
dgp 94b635d569 merge trunk 2017-06-08 20:58:10 +00:00
dgp de1c1f0f47 More streamlining 2017-06-08 20:57:06 +00:00
dkf a4f7145579 Make read and write operations on Tcl_Var handles available in tclInt API. 2017-06-08 20:49:51 +00:00
dgp 36d9205d97 More streamlining. 2017-06-08 20:40:45 +00:00
dgp 7673d614a9 pendingPtr == NULL implies (last == first) implies early out 2017-06-08 20:31:47 +00:00
dgp c348386388 Tests for string rep generation suppression 2017-06-08 19:35:05 +00:00
dgp 878c874975 merge trunk 2017-06-08 16:48:33 +00:00
dgp b796f3dee7 When possible delay string rep generation until necessary. 2017-06-08 16:44:51 +00:00
jan.nijtmans dd96539335 merge core-8-6-branch 2017-06-08 12:53:31 +00:00
jan.nijtmans 192d5ccf32 merge core-8-6-branch 2017-06-08 12:38:56 +00:00
jan.nijtmans fbfe81cc7b merge core-8-6-branch 2017-06-07 15:23:11 +00:00
jan.nijtmans 1b667ef114 merge core-8-6-branch 2017-06-06 14:35:02 +00:00
dgp 5667bb5f8e [716b427f76] Optimize TclStringCatObjv when only one non-empty argument. 2017-06-06 13:14:16 +00:00
dgp b0146fbd50 A few more tweaks to streamline and clarify. 2017-06-06 12:56:37 +00:00
sebres 615771f0b6 makes TclStringCatObjv safe accepting objc = 0 (or 1), then fast exits with new object / first; check-cycles rewritten to be still more faster. 2017-06-06 09:25:00 +00:00
jan.nijtmans 8d78b23f96 merge core-8-6-branch 2017-06-06 09:24:28 +00:00
sebres 7edce7686e amend to [eac4656f1e8cf793] (moved to scope where numChars != 0 in Unicode case) 2017-06-06 09:01:18 +00:00
sebres 3d8a0152af small code review: don't need to check length if unchanged + the same case if 0 length 2017-06-06 08:34:00 +00:00
dgp cb68061d12 Optimize TclStringCatObjv() for case when only one argument is non-empty. 2017-06-05 20:03:19 +00:00
dgp 5c4bb0f4e9 Revert performance optimization as first step to providing a refactored one. 2017-06-05 17:57:33 +00:00
dgp 8129d3e1c3 [67aa9a2070] Tcl_UtfToUniChar returns single byte for invalid UTF-8 input as documented. 2017-06-05 17:15:11 +00:00
jan.nijtmans f5f03750c8 merge core-8-6-branch 2017-06-02 10:59:19 +00:00
jan.nijtmans 21dfa74b03 Merge core-8-6-branch. This removes the work currently being done in "sebres-8-6-clock-speedup-cr1" branch, but that will be merged again as soon as the work is done.
All other changes in "trunk" since then (e.g. the INST_STR_CONCAT1 performance improvement, and the removal of SunOS-4) are retained.
2017-06-02 08:12:38 +00:00
jan.nijtmans 3f0e8d6265 Fix [83a3d869722fab9caaae3b6728215fb2507a6f0d|83a3d86972]: tclEpollNotfy.c fails to compile on Linux 2.6.<22 due to unconditionally including <sys/eventfd.h>
Also re-generate regc_locale.c with Unicode 10 tables: previous generation went horribly wrong somehow...
2017-05-31 13:03:54 +00:00
jan.nijtmans aaca962ffe merge core-8-6-branch 2017-05-31 12:06:51 +00:00
jan.nijtmans fcd399d49a Fix [67aa9a207037ae67f9014b544c3db34fa732f2dc|67aa9a2070]: Security: Invalid UTF-8 can inject unexpected characters 2017-05-31 12:05:45 +00:00
jan.nijtmans ca9d6593d1 merge core-8-6-branch (except: the "timerate" command and the clock performance-tests are kept) 2017-05-31 09:19:21 +00:00
jan.nijtmans 4a9ae53836 More code review, e.g. use Tcl_SetObjResult in stead of Tcl_SetResult, preventing a (char *) type case. No functional changes. 2017-05-31 08:59:28 +00:00
jan.nijtmans 60c071ed62 Remove "timerate" functionality: this definitely needs a TIP. Also undo changes in library/reg/pkgIndex.tcl, which are unrelated to clock functionality 2017-05-31 08:31:10 +00:00
sebres bbb13bf577 performance of INST_STR_CONCAT1: closes [716b427f76f8f97a8d9a06043903c53bb2b592c2]: minor optimization in simplest cases,
fixed performance regression of TclStringCatObjv usage from [fc9ed1e751180816384d569101950c1f8c4582ad],
optimizes patterns like "$v[unset v]", "$v[set v {}]" etc.
2017-05-31 08:24:42 +00:00
stu c05da96a35 Unbreak on OpenBSD, again. Put back the old SHLIB_VERSION doings.
On OpenBSD, Tcl's libs will need the extra version numbers probably forever.
There's no point to adding the extra knob.

On OpenBSD, the extra version numbers are used for dependency tracking.
The extra version numbers must be on linkable libs
(code will be linked to them, they have a corresponding .h file).
Loadable libs
(no code will be linked to them, they don't have a corresponding .h file.
Usually a Tcl extension)
don't need the burden (OpenBSD has to track the libs' dependencies)
of the extra version numbers.
Libs that are loadable and linkable are treated as linkable.
I hope that clears things up.
2017-05-31 06:10:46 +00:00
stu 73b3bf53ad Fully remove SunOS-4* from tcl.m4. 2017-05-31 05:39:57 +00:00
sebres 777941e35b [msgcat] revert changes of "msgcat" to previous state before clock-speedup, move this functionality to "clock.tcl";
additionally avoids the usage of catch (uses pair "dict exists/dict get" instead of).
2017-05-30 16:41:48 +00:00
sebres e06e0c8625 merge core-8-6-branch (resolves warnings) 2017-05-30 08:49:24 +00:00
sebres ece8767c5c small code review: resolves several warning on some compilers 2017-05-30 08:46:12 +00:00
sebres b63d3d703e 3-way merge sebres-trunk-clock-speedup / core-8-6-branch (clock speed-up / flightaware Tcl-bounties#4, see RFE [ddc948cff9781daac7ad95a3077b3c1b4f07cf93]) 2017-05-29 21:13:05 +00:00
sebres a59ccae461 merge sebres-8-6-clock-speedup 2017-05-29 20:37:35 +00:00
sebres 18315c5b5c merge sebres-8-6-clock-speedup (clock speed-up / flightaware Tcl-bounties#4, see RFE [ddc948cff9781daac7ad95a3077b3c1b4f07cf93]) 2017-05-29 20:23:56 +00:00
sebres c922cc78a8 merge core-8-6-branch 2017-05-29 19:44:55 +00:00
jan.nijtmans 3be2fece8c merge core-8-6-branch 2017-05-29 13:14:38 +00:00
griffin 919fc57599 0d in LinkVar 2017-05-28 16:06:29 +00:00
griffin 5badb6535f Implement proposed 0d decimal radix prefix to compliment 0x,0b,0o. 2017-05-27 22:17:21 +00:00
dgp cf0cf6ad90 [19a8c9399d] Plug mem leak in TIP 459 machinery. 2017-05-23 16:00:29 +00:00
jan.nijtmans f3ea991996 Update internal tables to Unicode 10.0. Still in Beta, but to be released soon. 2017-05-23 14:48:58 +00:00
jan.nijtmans 14949f27a3 Merge core-8-6-branch.
Obsolete a number of systems, which were already obsoleted by TEA: We cannot even create a "battery-included" release any more for those systems.
2017-05-22 09:16:12 +00:00
stu 62e71e311e Fix build on OpenBSD. [82701b94c4] missed a couple of bits.
Tcl/Tk's tcl.m4 isn't identical to TEA's tcl.m4 - be careful!
2017-05-20 12:45:31 +00:00
aspect df664778c8 merge core-8-6-branch 2017-05-19 14:23:06 +00:00
jan.nijtmans 34189452da merge core-8-6-branch 2017-05-18 13:27:10 +00:00
jan.nijtmans 2a5ae4319f TIP #458 implementation: Add Support for epoll() and kqueue() in the Notifier 2017-05-18 12:33:15 +00:00
jan.nijtmans dea5aab977 merge core-8-6-branch 2017-05-18 09:24:30 +00:00
sebres 993aa1b338 small amend with forgetten static keyword by option 2017-05-16 09:22:17 +00:00
sebres c3077bd013 optimized special case "-now" of base (by scan or add) or clock value (by format): bypass integer recognition if it looks like option "-now" 2017-05-16 09:16:43 +00:00
sebres 02d6d68a68 resolved warnings compiled with gcc, removed unused "MsgCtLitIdxs" (was moved to tclClock.c) 2017-05-16 08:51:51 +00:00
sebres c6484de085 merge sebres-8-6-clock-speedup 2017-05-15 18:35:36 +00:00
sebres dcc8bd9aa8 Fixed stardate format: be sure positive after decimal point (note: clock-value can be negative - modulo operation in C has the same sign as dividend) 2017-05-12 19:58:01 +00:00
jan.nijtmans 5d20272000 Don't test Tcl_GetDefaultEncodingDir() any more (which is obsolete), test Tcl_GetEncodingSearchPath() in stead. 2017-05-12 14:31:17 +00:00
sebres 0adb50f88b restored "-encoding utf-8" by source clock.tcl (lost by merging) 2017-05-12 07:45:15 +00:00
sebres a6c79230c3 merge sebres-8-6-clock-speedup 2017-05-11 21:55:12 +00:00
sebres 0ec19f6b11 fixes lost indentation during back-porting 2017-05-11 21:53:38 +00:00
sebres d6de0fb46b reintegrate sebres-8-6-clock-speedup back to sebres-clock-speedup (trunk clock-speedup, 3-way merge) 2017-05-11 19:44:01 +00:00
sebres 6b33bdad03 reintergrate (merge back) "sebres-8-6-timerate" into "sebres-trunk-timerate" 2017-05-11 19:06:53 +00:00
sebres 5171d6b4ef merge trunk (to sebres-trunk-timerate) 2017-05-11 18:53:21 +00:00
sebres 39a388f035 update documentation doc/clock.n: small enhancements and relevant changes of new engine. 2017-05-11 16:56:56 +00:00
sebres ea1ae51d2d [clock] tclStrIdxTree extended with possibility to hold client data; also changed in clock - indices starts with 1 instead of 0, and 0(NULL) instead of -1 used as sign of ambiguous keys. 2017-05-11 15:07:41 +00:00
sebres 95d531e781 prevents loss of key object if the format object (where key stored) becomes changed (loses its internal representation during evals);
should avoid possible theoretical segfault there.
2017-05-11 15:07:32 +00:00
sebres 1ea7d20306 auto-loading of ensemble and stubs on demand only (+ test covered now, see clock-0.1);
introduces new possibility to implement namespace-based auto-loading, e. g.:
    set ::auto_index_ns(::some::namespace) [list ::source [::file join $dir some namespace.tcl]]]

loading of clock-stubs (clock.tcl) implemented via handler "auto_index_ns" now.
2017-05-11 12:32:47 +00:00
sebres 0cdf2fd457 performance test cases extended: several cases to cover absence of the ensemble overhead 2017-05-11 12:25:59 +00:00
sebres 5202a013d2 merge sebres-8-6-timerate 2017-05-11 09:47:36 +00:00
sebres f9abf9b060 man for timerate (doc/timerate.n) 2017-05-11 09:46:43 +00:00
sebres 2eaa3d3c8d Added files missing after merge/back-port (rebase with merge point) 2017-05-10 13:02:17 +00:00
sebres 19b2d40089 Fixed possible wrong current date for CET / CEST test cases. 2017-05-10 12:30:04 +00:00
sebres ba8e7c4211 Fixed wrong args message (e.g. "clock format ..." instead of "::tcl::clock::format") if failed through compiled ensemble execution. 2017-05-10 12:29:59 +00:00
sebres 3fe213e031 Ensemble "clock" fixed after merge with kbk's clock ensemble solution. All commands (including new) compiled now also in ensemble (implemented without TclMakeEnsemble, because it can be extended via new map entries).
Ensemble handling partially cherry-picked from new performance branch (TODO: check temporary "-compile" option can be reverted if it becomes ready/merged).
2017-05-10 12:29:54 +00:00
sebres d9b0bec7d6 resolving differences between 8.6 and trunk 2017-05-10 12:29:49 +00:00
sebres a021af135e clock.test normalized (compared with trunk) 2017-05-10 12:29:42 +00:00
sebres ee3d72e1e1 [interim-merge-commit] back-ported branch sebres-clock-speedup (from trunk to 8.6): tcl-clock functionality rewritten in C. 2017-05-10 12:28:46 +00:00
sebres 2752a9f58b add missing compile functionality (TclPreserveByteCode/TclReleaseByteCode back-ported as inline from trunk) 2017-05-09 22:24:44 +00:00
sebres a73818d8b6 back-ported branch sebres_trunk_timerate (new command "timerate" for 8.6) 2017-05-09 21:58:12 +00:00
jan.nijtmans 2130fd8582 merge core-8-6-branch 2017-05-09 11:31:14 +00:00
jan.nijtmans 1ed15145a6 merge core-8-6-branch 2017-05-09 09:49:23 +00:00
dgp ca65694482 [6015221f59] Segfault after overflow of [binary] field specifier numeric count. 2017-05-05 19:11:33 +00:00
dgp dd53d408e3 merge trunk 2017-05-04 14:51:22 +00:00
jan.nijtmans b5273bc1fa merge trunk 2017-05-04 14:19:52 +00:00
jan.nijtmans ce501f14c5 merge core-8-6-branch 2017-05-04 12:28:44 +00:00
jan.nijtmans 63cf0366bd merge core-8-6-branch 2017-05-04 09:51:00 +00:00
jan.nijtmans 52e520be10 merge trunk 2017-05-04 08:55:28 +00:00
jan.nijtmans af718696fb merge core-8-6-branch 2017-05-03 15:28:37 +00:00
jan.nijtmans 709366bdfe slightly better formatting, both in genStubs.tcl and in the generated XXX_DEPRECATED functions. 2017-05-03 10:03:00 +00:00
jan.nijtmans 910200b637 Extend "deprecated" functionality of genStubs.tcl: XX_DEPRECATED macro now accepts a message text, which will be used in the compiler's error message.
Not used (yet) in Tcl.
2017-05-02 12:36:42 +00:00
dgp be831d7ecb Revert the colorful debug garbage mistakenly committed. 2017-05-01 20:29:02 +00:00
dgp 44c544160a [f9fe90d0fa] [file join] normalization. See filesystem-1.52* 2017-05-01 20:25:27 +00:00
jan.nijtmans 799554b1c5 merge core-8-6-branch 2017-05-01 08:22:56 +00:00
fvogel 90ffbb4170 Make trunk compile on MSVC (problem was: warning C4554: '&' : check operator precedence for possible error; use parentheses to clarify precedence) 2017-04-29 14:41:20 +00:00
dgp adfd841d9d [f34cf83dd0] An optimization was being taken in a case where it produced the wrong result, failing to collapse multiple /// into /. Testing on Windows where path expectations may vary would be a good idea, but since this is just an optimization avoidance, I suspect we're ok. 2017-04-28 17:57:34 +00:00
dgp 198407b5ba Test for [f34cf83dd0]. 2017-04-28 17:46:11 +00:00
dgp 83495af5ce silence uninit variable warnings 2017-04-28 14:15:56 +00:00
jan.nijtmans 10ab52081d merge core-8-6-branch 2017-04-28 13:21:26 +00:00
dgp 0b9703a36f [04e26c02c0] Remove useless condition that raises warnings. 2017-04-27 17:26:10 +00:00
dkf e3a9350e58 Start of implementation of TIP #470. 2017-04-27 12:38:21 +00:00
dkf 04086099d0 [50750c735a] Fix broken test and stop reading uninit-but-allocated memory in zlib channel transform. 2017-04-27 10:51:50 +00:00
jan.nijtmans fbbc93906e Move some variable declarations closer to where they are used. No change in functionality. 2017-04-26 13:48:13 +00:00
jan.nijtmans 2f99ece694 merge core-8-6-branch 2017-04-20 14:47:01 +00:00
jan.nijtmans c1b1e9af62 Remove unused functions like TclWinSetSockOpt()/Tcl_DStringTrunc() if compiled with -DTCL_NO_DEPRECATED 2017-04-20 11:44:05 +00:00
gcramer bcbbf6dacf Entry for text.n into exclude_refs_map inserted. 2017-04-20 10:13:02 +00:00
jan.nijtmans 93a924d020 merge core-8-6-branch 2017-04-18 19:02:51 +00:00
jan.nijtmans 3bde30215b merge-mark 2017-04-18 06:15:48 +00:00
dgp bfdfb7479d Repair revised tests that failed. 2017-04-17 12:05:02 +00:00
jan.nijtmans 2c5d1036db merge trunk 2017-04-14 13:00:46 +00:00
jan.nijtmans 46db6e4a00 merge trunk 2017-04-14 10:04:33 +00:00
jan.nijtmans 15b0a7813d merge core-8-6-branch 2017-04-14 09:06:34 +00:00
jan.nijtmans 6be0cf66e0 Translate all \u???? sequences to their UTF-8 counterpart in *.msg files: It is faster during parsing (since no backslash-sequences have to be handled) and makes the msg-files better readable by humans.
TODO: adapt tools/loadICU.tcl to generate UTF-8 in stead of those sequences. This tools seems to be out-of-date a long time already, I couldn't make it run with latest ICU.
2017-04-13 12:20:37 +00:00
jan.nijtmans cddb5b612f merge trunk. New TIP is getting shape. 2017-04-12 13:49:33 +00:00
jan.nijtmans 5ba18ec98d If %llu is considered invalid, it means that "%" TCL_LL_MODIFIER "u" cannot be used Tcl_ObjPrintf(), but only in sprintf(). That's unfortunate, clearly an oversight in TIP #237. Conclusion: new TIP must be written to correct this.
I'll read a TIP and see what case you have, but TCL_LL_MODIFIER was never
meant to play any role in [format] or in Tcl_ObjPrintf(). TCL_LL_MODIFIER
exists to help deal with platform differences in sprintf() calls.

Tcl_ObjPrintf() in contrast ought to be consistent in its behavior
across platforms and should not need such things. If that's false,
then fixes to Tcl_ObjPrintf() are in order.
2017-04-12 13:43:15 +00:00
dgp 62b2b9bf45 Revert recent commit. TIP 237 is clear that %llu is invalid. 2017-04-12 13:15:39 +00:00
jan.nijtmans e006ff39be merge core-8-6-branch 2017-04-12 12:33:07 +00:00
jan.nijtmans d56986e037 merge trunk 2017-04-12 10:06:32 +00:00
jan.nijtmans 9b4213bb3f merge core-8-6-branch 2017-04-12 09:35:18 +00:00
jan.nijtmans cd48f2d313 Remove some unnecessary "struct" definitions and some type casts no longer necessary. No functional changes. 2017-04-11 15:20:07 +00:00
jan.nijtmans 26f98a5e56 unbreak windows build (by previous commit) 2017-04-11 11:30:47 +00:00
dkf bbfc7b1ea2 More minor style fixes. 2017-04-10 16:21:31 +00:00
jan.nijtmans 1e3fa455c9 Merge Harald's "robust-async-connect-tests" branch. Thanks! 2017-04-10 12:39:54 +00:00
dkf d00198bd14 Minor style issues through the socket implementation code. 2017-04-09 16:51:27 +00:00
jan.nijtmans e9b2f70238 merge trunk 2017-04-07 15:15:42 +00:00
jan.nijtmans ff4b11441b Minor simplification in tcl.h: For the Tcl_WideAsLong/Tcl_LongAsWide/Tcl_WideAsDouble/Tcl_DoubleAsWide #defines, one set suffices: No need to have two versions depending on TCL_WIDE_INT_IS_LONG. 2017-04-07 15:11:47 +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 904733362e Some more (internal) stub entries which can be cleaned up with -DTCL_NO_DEPRECATED, because they are not used any more. 2017-04-06 15:25:44 +00:00
jan.nijtmans 44de3dd8da If compiled with TCL_NO_DEPRECATED, the functions TclpGetDate/TclpLocaltime/TclpGmtime can be removed: They are internal and not used for anything any more. 2017-04-06 11:13:22 +00:00
max 55edd253ff Use a random unused port for the dummy http server to avoid conflicts
with local services running on port 8010.
2017-04-05 14:47:45 +00:00
jan.nijtmans 19719bf57f Fix [4b12ccb3363e81b132e8dbe12aeec596102be1a8|4b12ccb336]: format/scan %llu doesn't work. Also added new test-cases showing the expected behavior. 2017-04-05 09:09:20 +00:00
jan.nijtmans 85397cf893 Merge core-8-6-branch.
Add test-cases showing that the (undocumented) %p format (and also %zd/%td) are harmless, since they are equivalent to other already existing formats.
2017-04-03 12:54:36 +00:00
jan.nijtmans ce7746b49e Since Tcl_AppendPrintfToObj() now understands the %p format, we can use it. Eliminating some internal string buffers. 2017-03-31 14:44:08 +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 354e08673b Extend Tcl_DumpActiveMemory() and related functions for handling 64-bit memory. Only effective with TCL_MEM_DEBUG.
Merge-mark core-8-6-branch (this doesn't bring in any changes)
2017-03-31 09:19:05 +00:00
dkf 810395f913 [900cb0284bc] Ensure that masking pseudo-methods used for export management are not introspectable directly. 2017-03-29 19:07:44 +00:00
dkf 8dfdec39fd Tweak to make tests a little clearer. 2017-03-29 19:05:17 +00:00
jan.nijtmans 30cebba4d6 merge trunk 2017-03-29 14:57:15 +00:00
jan.nijtmans 0abecbc87d Fix [4768eb5c166a1b923e3472d18d75fdccc1a47513|4768eb5c16]: format-8.20 failure. Since "%q" now is a valid length specifier, we cannot use it any more to test for "bad field specifier" 2017-03-29 14:53:54 +00:00
jan.nijtmans afc0ba5cdc merge trunk 2017-03-29 13:23:11 +00:00
jan.nijtmans efbb62b5bd In comments and documentation, distinguish between __int64 (a Microsoft 64-bit integer type) and int64_t (C99 equivalent) 2017-03-29 12:19:02 +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
jan.nijtmans dd5e309d31 Improve comment on TCL_WIDE_INT_IS_LONG, making it less misleading.
In tclThreadTest.c, allow mainThreadId to be >32 bits.
2017-03-27 13:02:39 +00:00
aspect 0c0b1e1498 Correct this use of isWanted to ensure NO_IMPLEMENTATION methods are not listed (bug [900cb0284bc]) 2017-03-27 13:02:22 +00:00
f.bonnet f0aac87b35 Create new branch named "tip-462" 2017-03-27 09:28:55 +00:00
jan.nijtmans 920aa8280f Supply more C99-compatible (and MSVC) format options: '%p' for pointers, 'z'/'j'/'I' for size_t/intptr_diff, 'j'/'q' for long long. Also add "I32" froom MSVC.
Remove TCL_LL_MODIFIER specified as "L" for Borland: This must be wrong as "L" is meant for long double. Just assume that later Borland compilers are MSVC-compatible.
2017-03-24 15:52:42 +00:00
jan.nijtmans 8a2c820213 Merge trunk 2017-03-24 10:30:56 +00:00
jan.nijtmans ab08379d1c Add TCL_NORETURN attribute to TclpThreadExit() and Tcl_ExitThread() 2017-03-24 09:33:00 +00:00
jan.nijtmans 321cd769b7 Use portable %p modifier in "generic/tclThreadTest.c", in stead of more complicated TCL_LL_MODIFIER. 2017-03-23 16:35:08 +00:00
José Ignacio Marín 91cb892574 merge with trunk 2017-03-23 08:42:38 +00:00
dgp e58e9e1fb9 New(ish) test interp-14.11 was missing its -cleanup. 2017-03-22 19:46:56 +00:00
jan.nijtmans dc25a1a62b Addendum to previous commit: If compiled with TCL_NO_DEPRECATED, remove a few more stub entries which are not used any more. 2017-03-21 09:01:09 +00:00
jan.nijtmans 754b233873 If compiled with TCL_NO_DEPRECATED, remove some more stub entries which are not used any more. 2017-03-20 10:24:11 +00:00
jan.nijtmans 5617ad7c18 If Tcl is compiled with -DTCL_NO_DEPRECATED, make sure that iPtr->(resultSpace|appendResult|appendAvl|appendUsed) are not used any more. 2017-03-17 10:57:24 +00:00
dkf 909f1a1a30 Fixes to docs made possible by recent HTML rendering fixes for Tk. 2017-03-16 09:07:19 +00:00
jan.nijtmans f6837a8ef4 redundant end-of-line spacing 2017-03-15 15:15:50 +00:00
Kevin B Kenny 488735e4a2 Compile [clock clicks], [clock microseconds], [clock milliseconds] and [clock seconds]. 2017-03-15 02:40:56 +00:00
Kevin B Kenny a3f676461c Make 'clock' and 'encoding' into compilable ensembles that play with safe interps 2017-03-14 22:22:40 +00:00
jan.nijtmans 6f905e1f0f Eliminate internal use of TclNewBooleanObj()/TclSetBooleanObj()/TclSetIntObj(). Replace Tcl_DbNewBooleanObj() with trivial macro. 2017-03-13 08:38:18 +00:00
dkf 4ccedfaec4 Add back missing significant character 2017-03-13 06:16:45 +00:00
fvogel c010901ea9 Fix error in formatting in info.n 2017-03-12 19:45:00 +00:00
dkf c0bedd810f Add mappings for groff-style character naming, used in experimental branches of Tk. 2017-03-12 18:36:21 +00:00
José Ignacio Marín 5d66bf5a1f Merge the update of TZ info with trunk. 2017-03-10 17:07:44 +00:00
jan.nijtmans f55296bdf0 minor simplification 2017-03-08 14:50:44 +00:00
jan.nijtmans bed000d72e A few more end-of-line spacings 2017-03-08 14:32:15 +00:00
jan.nijtmans b2181df698 Fix compile error on Cygwin, and double definition of TclUnixWaitForFile() 2017-03-08 13:56:55 +00:00
jan.nijtmans 6469ae095f Re-base to trunk, and get latest code from here: [https://github.com/lalbornoz/tcl/tree/tip458]. Untested. 2017-03-08 13:35:23 +00:00
sebres 636e904b09 merge core-8-6-branch 2017-03-07 18:21:24 +00:00
sebres 30dc72c0aa merge sebres-trunk-timerate 2017-03-07 11:38:31 +00:00
sebres 279bfdeef3 timerate: don't calculate threshold by too few iterations, because sometimes first iteration(s) can be too fast (cached, delayed clean up, etc). 2017-03-07 11:35:03 +00:00
jan.nijtmans da85dcc288 Fix [e14d152114efee10394a7e0b4b1c0478efff52c5|e14d152114]: bundled zlib documentation is under a potentially non-free license 2017-03-07 11:08:47 +00:00
jan.nijtmans ac3cb936ee Merge core-8-6-branch 2017-03-07 09:47:41 +00:00
sebres fa0de66105 tclEmptyStringRep -> &tclEmptyString 2017-03-06 21:01:53 +00:00
sebres aaa76b7a7d msgcat.test: fixed mcpackagelocale syntax usage test case (msgcat-12.1) 2017-03-06 20:32:54 +00:00
sebres ad788184e3 merge trunk 2017-03-06 20:19:39 +00:00
sebres aec683eef8 merge trunk 2017-03-06 20:18:35 +00:00
sebres 41646a2294 merge core-8-6-branch 2017-03-06 20:10:42 +00:00
avl ef3d739cdf Fix for Ticket [71c0878b71] + test cases 2017-03-05 15:05:48 +00:00
dgp 0f7d84bbbf ParseTokens failed to fully respect its numBytes argument. 2017-02-27 14:53:32 +00:00
dkf 7088b7efe3 [25842c161f] Ensure that finalization of a zlib stream works. 2017-02-26 15:33:04 +00:00
dkf 874b8643e0 Add documentation of [regsub -command]. 2017-02-18 18:38:52 +00:00
dkf d18329a21e Testing for some error cases. 2017-02-18 16:24:09 +00:00
dkf 82296abf08 Add more representation smashing testing and a memleak test. 2017-02-18 14:26:34 +00:00
dkf 5772e32729 Stop problems with representation smashes. 2017-02-17 09:20:49 +00:00
dkf 3ef7160d41 Switch to using command prefixes properly. This is quite a bit faster. 2017-02-17 06:08:18 +00:00
jan.nijtmans 462ffc7927 More internal use of size_t in stead of int, e.g. for epoch's 2017-02-15 14:04:15 +00:00
jan.nijtmans a13289725c On Windows, Cygwin and 64-bit platforms, no need to handle 'long' in tclLink.c, since its size is equal to either 'int' or 'Tcl_WideInt'. This enhances interoperabilty between win64 extensions loaded in cygwin64 using Tcl_LinkVar(), whill still being 100% compatible.
init.tcl:  unnecessary spacing.
2017-02-14 14:25:08 +00:00
dkf efa3ec6939 Proposed implementation of [regsub -command]. 2017-02-11 21:36:36 +00:00
sebres 2bb76d85aa merge sebres-trunk-timerate 2017-02-09 13:50:27 +00:00
sebres 8dde174dd4 [win] accomplished winTime module using very fast wide clicks, with denominator scale to/from microseconds, and therefore more precise "timerate" results under windows (using similar mechanisms as by Mac OSX).
Especially multi-threaded, because it works without lock opposite to microseconds (that use crictical section, because of the calibration thread).
The reason for usage of wide clicks instead microseconds explains following example (shows 20% performance deference):
% timerate -calibrate {}
% timerate {clock microseconds} 5000
0.297037 µs/# 14465901 # 3366585 #/sec 4296.906 nett-ms
% timerate {clock clicks} 5000
0.247797 µs/# 16869084 # 4035554 #/sec 4180.116 nett-ms
2017-02-09 13:45:14 +00:00
sebres ca98340c4c [timerate] bug fix: missing scale conversion by Mac OSX on platform where high resolution clicks are not microseconds based;
[win] use high resolution timer for the wide clicks and microseconds directly, prevent several forwards/backwards conversions;
[win, unix, mac-osx] normalize some functions for common usage in different time units (clicks, micro- and nanoseconds)
2017-02-09 11:36:17 +00:00
sebres 35539e2f98 resolve warning: enumeration value ‘TMRT_LAST’ not handled in switch (impossible to handle in switch because of break); 2017-02-09 11:34:43 +00:00
jan.nijtmans 8fb5bb0f20 TIP #459 feedback from FlightAware: Add package-related pkgIndex.tcl file to "package files" output. 2017-02-08 22:01:45 +00:00
jan.nijtmans 6db42b86e6 Shortcut in TclParseNumber(): If obj is a dict or list, don't bother to generate the string representation if we know already beforehand that the parsing will fail.
Use TCL_NO_DEPRECATED in stead of KILL_OCTAL for removing the (deprecated un-prefixed) octal support.
Adapt test-cases, so they work without octal support as well.
2017-02-08 14:32:13 +00:00
jan.nijtmans 8066c6a687 FlightAware feedback: "Aside: Any way to find out what the pkgIndex.tcl file a package was defined in was, or does that happen at too high a level?"
Answer: Even though the name of the pkgIndex file is available earlier, it is very well possible to remember it and store it with the other files. This commit does exactly that.
2017-02-08 11:42:12 +00:00
jan.nijtmans 4671050f10 Code cleanup (based on feedback from René Zaumseil): Only call GetInvalidIntFromObj() when Tcl_GetIntFromObj() fails. 2017-02-07 12:27:19 +00:00
bch 0e31751aed cherrypick typo fix. 2017-02-06 21:58:48 +00:00
jan.nijtmans 19e0981d35 Split tclEmptyStringRep declaration over two lines. Otherwise gcc warning. 2017-02-03 14:29:50 +00:00
jan.nijtmans b2a59d29b6 TIP #459 remaining part of implementation. Makes "package require Tk" give the right (... at least ... the expected ...) answer. 2017-02-03 12:27:37 +00:00
jan.nijtmans d917353c7e In TclGetNumberFromObj() macro (tclExecute.c): Don't fill in type if TCL_ERROR is returned: The caller doesn't do anything with this.
Don't access (non-const) variable tclEmptyStringRep any more, use its value (&tclEmptyString) directly. Only keep it in tclPkg.c, for error checking.
2017-02-03 11:47:02 +00:00
jan.nijtmans 5fdbd4a749 Fix [d0f7ba56f0e8f93b7efb5b09ebc30a824bdd577a|d0f7ba56f0]: INST_EQ first-argument NaN shortcut is too aggressive 2017-02-01 14:55:02 +00:00
jan.nijtmans 17cf9db2f7 Update documentation on recent changes in Tcl_LinkVar.
Minor code clean-up. No functional changes.
2017-01-31 13:27:28 +00:00
ashok 4b357897d5 Added assoc, ftype and move as auto_execok shell built-ins on Windows. 2017-01-28 06:38:22 +00:00
jan.nijtmans 68275b03de Some code cleanup: More internal use of size_t, less type casts (because of this). No functional changes. 2017-01-27 14:31:12 +00:00
jan.nijtmans 2645c0ef3a If TCL_NO_DEPRECATED is defined, remove the "case" statement, and use much less interp->result. Implementation mostly taken over from "novem". If TCL_NO_DEPRECATED is not defined, nothing changes. 2017-01-25 12:22:16 +00:00
jan.nijtmans 7de961e9fa Merge trunk 2017-01-23 09:11:34 +00:00
jan.nijtmans c26df8ae12 Fix [39f6304c2e90549c209cd11a7920dc9921b9f48e|39f6304c2e] follow-up: Make Tcl_LinkVar toleranto to the empty string as well 2017-01-20 16:21:43 +00:00
fvogel 47692f4e99 Fix [1f4bb8162f]: lsort -dictionary documentation to be improved 2017-01-19 22:38:40 +00:00
jan.nijtmans e7e764dbdf Implement tag "deprecated" in genStubs.tcl. Will be used in Tk 8.7, for tagging the deprecated function Tk_FreeXId() 2017-01-17 12:02:43 +00:00
jan.nijtmans b0aa1e2416 merge core-8-6-branch 2017-01-17 10:04:42 +00:00
jan.nijtmans 3dba96d22a Fix for missing proper initialization of the threaded allocator in some situations. Problem reported by Zoran Vasiljevic, only noted when building/running NaviServer/AOLServer with Tcl 8.7 (trunk). 2017-01-16 11:57:17 +00:00
jan.nijtmans a0ea496ffb Update zlib to version 1.2.11 2017-01-16 11:53:07 +00:00
venkat 893b999f51 Merge IETF tzdata2016j 2017-01-14 08:47:15 +00:00
jan.nijtmans 35d8e3912d Introduce new function TclInitThreadAlloc(), symmetric with TclFinalizeThreadAlloc() 2017-01-13 14:43:07 +00:00
sebres 4c239ca4d9 merge trunk 2017-01-13 14:22:31 +00:00
jan.nijtmans a89608d308 Merge-mark (restoring the expected merge order from core-8-5-branch -> core-8-6-branch -> trunk -> novem) 2017-01-13 13:02:32 +00:00
sebres bd9426f3e5 missing rules.vc after merge 2017-01-13 12:57:45 +00:00
jan.nijtmans abdbe053ea Enhance nmakehlp, allowing multiple arguments for "-l", and recognizing a new linker code LNK4224. Patch by sebres. 2017-01-13 12:20:21 +00:00
jan.nijtmans 6ecb7aeabf Patch from Zoran Vasiljevic, fix for missing proper initialization of the threaded allocator in some situations. 2017-01-13 11:17:17 +00:00
jan.nijtmans d42b3a00d3 Merge core-8-6-branch 2017-01-12 10:34:05 +00:00
sebres 77481ec3e1 code review and inline documentation 2017-01-11 16:36:28 +00:00
sebres f03990cd12 code review: small optimization of msgcat::mcget, prevents infinite loop if at all no translation 2017-01-11 16:35:41 +00:00
jan.nijtmans 1ebb964dbc Use more Tcl_AppendResult(), in order to prevent the use of a (char *) type case. 2017-01-11 16:23:18 +00:00
jan.nijtmans e6d3efd5e1 Merge core-8-6-branch.
Do gcc-compiles with the option -Wwrite-strings, so we can detect mis-usage of "const".
Make Tcl_AddErrorInfo() and Tcl_AddObjErrorInfo() a macro.
2017-01-11 14:10:33 +00:00
sebres a841205be9 amend lost changes after rebase to fossil 2017-01-10 23:09:23 +00:00
sebres df7cbb28e0 small amend (reset have rel flag) 2017-01-10 23:02:14 +00:00
sebres 01697f2acc "clock add" rewritten in C, using common functionality of "clock scan" (and freescan)...
test-performance.tcl: test cases extended to cover "clock add"
2017-01-10 23:02:02 +00:00
sebres 0a1c05fbb8 code review and inline documentation 2017-01-10 23:01:23 +00:00
sebres 8fa2e7802e correct output of total resp. average values considering net execution time (overhead considered) 2017-01-10 23:00:05 +00:00
sebres c2ee1525ef [unix] resolving of several warnings (gcc 5.x):
- static used in non-static inline function;
- x64 int cast on pointer [-Wpointer-to-int-cast];
- (obscure) may be used uninitialized in this function [-Wmaybe-uninitialized];
- TclEnvEpoch initialized and declared extern;
2017-01-10 22:59:16 +00:00
sebres ae731e3e50 test-performance: added calibration of timerate to minimize influence of the parasitical execution-overhead by extremely fast execution times 2017-01-10 22:58:29 +00:00
sebres bc879a58f2 Merge remote-tracking branch 'remotes/fossil/trunk' into sb/trunk-rewrite-clock-in-c; + minor fixes after merge. 2017-01-10 22:56:13 +00:00
sebres d551c0972c [unix] build for *nix fixed, code clean-ups; missing declarations; unused vars, functions etc; types normalization; 2017-01-10 22:55:00 +00:00
sebres 27fd5c0793 dict: unused variable removed 2017-01-10 22:53:05 +00:00
sebres 264cc47fd4 another way to make greedy search more precise, some greedy matches are fixed (see test cases clock-6.22.11 - clock-6.22.20), additionally involving look ahead token of known type into pre-search process. 2017-01-10 22:52:44 +00:00
sebres 866efbc904 some greedy matches are fixed (see test cases clock-6.22.11 and clock-6.22.12), involving space count in look ahead and end distance calculation (because spaces are optional in date-time string as well as in scanning format). 2017-01-10 22:52:12 +00:00
sebres 941e45f907 clock.tcl: clean unused resp. obsolete commands 2017-01-10 22:45:59 +00:00
sebres 7a654297a0 small code review, performance test cases ready. 2017-01-10 22:45:29 +00:00
sebres 4600d7c026 performance test cases ready 2017-01-10 22:44:55 +00:00
sebres c97ddc73f6 several missing scan tokens added, test cases extended and fixed;
token "%s" used for seconds only (time zone independent), additionally "%Es" token added for local seconds (zone dependent seconds);
2017-01-10 22:44:30 +00:00
sebres bd20b3429a porting of clock format completed; all clock test cases passed 2017-01-10 22:43:22 +00:00
sebres d830389b53 [temp-commit]: format almost ready (missing some tokens), sprintf replaced with _itoaw (because "sprintf" too slow) 2017-01-10 22:42:15 +00:00
sebres 63c8495242 [temp-commit]: format almost ready (missing some tokens) 2017-01-10 22:41:18 +00:00
sebres 9d7b1b2b03 min length of %Y token (year with century) is 4, optional tokens possibility (zone), test cases extended 2017-01-10 22:40:16 +00:00
sebres 0f7c885e8c other locale scan token switched from list seek to index tree + list search case insensitive now 2017-01-10 22:39:45 +00:00
sebres 95b63f4c39 locale months scan switched to from list seek to index tree; bug fixing 2017-01-10 22:38:56 +00:00
sebres 20ec6252d1 lowercase on demand, string index tree can search any-case now, clock scan considered utf-8 char length in words by format parsing 2017-01-10 22:38:22 +00:00
sebres 2ba998572c string index tree for fast greedy search of the string (index) by unique string prefix as key;
clock scan rewritten to use string index tries search;
2017-01-10 22:37:40 +00:00
sebres c5ff074db9 cacheable conversions Local2UTC / UTC2Local fixed (some TZ switches time seconds bound) and optimized (last period ranges saved);
prepare to back-port clock format
2017-01-10 22:36:19 +00:00
sebres 717e43f1bd estimate token count by % char and format length (don't use fix TOK_CHAIN_BLOCK_SIZE by creation, minimized memory usage) 2017-01-10 22:35:34 +00:00
sebres e130d09c74 small optimization (determine min/max length, end distance, etc.) 2017-01-10 22:35:14 +00:00
sebres 36d60df82c clock scan almost ready (currently test-case covered tokens only), test cases passed; todo - check other tokens from "clock.tcl" 2017-01-10 22:34:42 +00:00
sebres e9177a25c1 bug fix by match word token (FindWordEnd fixed);
repaired current locale switch
2017-01-10 22:34:11 +00:00
sebres 02b4c1de38 repaired system/current locale caching (also for legacy clock format) and legacy timezone cached as last 2017-01-10 22:33:41 +00:00
sebres feb62aa2bd scan format: several tokens implemented, bug fixing and code review;
precedence yyyymmdd over yyyyddd was changed (and re-covered in test-cases also), see http://core.tcl.tk/tcl/tktview/e7a722cd3573fedda5d1e528f95902776f996e06
2017-01-10 22:32:46 +00:00
sebres 6c38124bb9 %j token as day of year; clear flags implemented (to provide last-wins functionality) 2017-01-10 22:31:43 +00:00
sebres caf50ef7ea seconds token (%s) take precedence over all other tokens 2017-01-10 22:31:12 +00:00
sebres c51ce8e879 list index logic optimized regarding greedy search (don't stop by first found - try to find longest) 2017-01-10 22:30:49 +00:00
sebres 94dc5e4e43 improve LocalizeFormat, internal caching of localized formats inside msgcat for locale and format objects
smart reference introduced in dict (smart pointer with 0 object reference but increase dict-reference, provide changeable locale dict)
code review
2017-01-10 22:30:24 +00:00
sebres c52322d409 improve LocalizeFormat, internal caching of localized formats inside msgcat for locale and format objects
smart reference introduced in dict (smart pointer with 0 object reference but increase dict-reference, provide changeable locale dict)
2017-01-10 22:28:25 +00:00
sebres a4c93085d2 l10n (with caching) implemented, msgcat package optimized, code review, etc. 2017-01-10 22:25:20 +00:00
sebres 18dc49dd08 [temp-commit]: not ready 2017-01-10 22:23:37 +00:00
sebres c5d6cc90d9 several initialize and finalize facilities 2017-01-10 22:21:26 +00:00
sebres bcb2a0a181 amend for caching of UTC2Local / Local2UTC:
* tzdata used internally only (because cached, replaced with timezone object as parameter for several functions)
  * small improvement (don't need to convert UTC to UTC)
2017-01-10 22:20:25 +00:00
sebres 940c0805c0 [temp-commit]: code review, DST-hole mistake by scan with relative time resolved;
caching of UTC2Local / Local2UTC cherry picked
2017-01-10 22:19:01 +00:00
sebres a3c42aef3e [temp-commit]: clock scan tokenizer logic ready (still needs many rules)
caching extended (currentYearCentury, yearOfCenturySwitch, lastBaseDate ...)
2017-01-10 22:15:36 +00:00
sebres aba1f29686 [temp-commit]: rewrite scan token map handling 2017-01-10 22:12:07 +00:00
sebres 898bc97bbe [temp-commit]: tclClockFmt.c - amend for 2nd try (with cherry picking of tclSE incompatible facilities)
Prepared for common usage of both scan commands - free scan / scan with format (currently faked via eval to __org_scan);
test cases passed.
2017-01-10 22:10:44 +00:00
sebres 5ab3eafa66 [temp-commit]: tclClockFmt.c - 2nd try (with cherry picking of tclSE incompatible facilities)
Prepared for common usage of scan command (free scan / format scan)
2017-01-10 22:09:02 +00:00
sebres 1f1f1e4dfc [temp-commit]: tclClockFmt.c - 1st try
using "timerate" instead "time" by performance measurement tests (more precise and fixed time, so no switch of factor expected)
2017-01-10 22:07:37 +00:00
sebres 32b5c49ef3 [temp-commit]: ClockFreeScan back-ported (cherry picked), all tests case passed + several new test-cases for bug fixing implemented here;
environment epoch ported, several fixes for the time zone / tzdata caching ported;
mem-leak fix + memory leak test cases passed
2017-01-10 22:04:49 +00:00
sebres 21878028d5 [temp-commit]: ClockFreeScan ready, test case passed (2 failure because of wrong :localtime zone by TZ-switch, to be fixed) 2017-01-10 22:02:10 +00:00
sebres 18b31092c6 [temp-commit]: ClockFreeScan seems to be ready, test case should be checked 2017-01-10 22:01:13 +00:00
sebres 736824a259 [temp-commit]: ClockFreeScan almost ready, test-performance cases merged 2017-01-10 21:59:59 +00:00
sebres 9e52bb21b7 [temp-commit]: clock scan with several optimization porting, still not-ready 2017-01-10 21:58:33 +00:00
sebres a3433951b0 1st try to rewrite clock in C 2017-01-10 21:57:06 +00:00
sebres ad284758d3 Create new branch named "sebres-clock-speedup" 2017-01-10 21:20:03 +00:00
sebres 6aed9a6630 [win] load win-registry library also in development environment (uninstalled) 2017-01-09 19:33:23 +00:00
sebres 704f3a5483 missing entry of tclInt.h added 2017-01-09 19:31:08 +00:00
sebres 2de37edd0d New performance measurement routine "timerate" in opposition to "time" the execution
limited by fixed time (in milliseconds) instead of repetition count (more precise 
results, to prevent very long execution time it is no more necessary to estimate 
repetition count)

Syntax: timerate ?-direct? ?-calibrate? ?-overhead double? command ?time?
2017-01-09 19:09:49 +00:00
sebres ec306bb22e Merge fix clock test-cases from 8.6: Make test clock-67.5 time zone independent - execution fails in the time zones below gmt 2017-01-09 18:28:56 +00:00
sebres 8b67c7f038 Merge bug_b87ad7e914 2017-01-09 17:53:00 +00:00
jan.nijtmans cc89e55f7d Merge trunk 2017-01-06 11:39:10 +00:00
jan.nijtmans 860e480e47 Complete the upgrade to Zlib 1.2.10: Now add the *.lib and *.dll files 2017-01-06 10:30:31 +00:00
jan.nijtmans 03d119a937 Make TclGetLoadedPackagesEx() work with other than the only current interpreter (didn't really think about that earlier ... ). Actually slightly more correct. 2017-01-05 15:13:58 +00:00
jan.nijtmans 3703dbd940 Merge trunk 2017-01-05 14:47:07 +00:00
jan.nijtmans 570a13bc17 Fix [7c7d3b4481d4e4e86420b54031f4abd1df18d64|7c7d3b4481]: load test failures. There's a difference between "" and NULL as interpreter name. 2017-01-05 14:27:20 +00:00
jan.nijtmans 8da19e064b One more ::tcl::Pkg::source, for the Mac 2017-01-05 13:09:26 +00:00
jan.nijtmans 666afa7352 Merge trunk. Improve test-case. Bring back "source -nopkg", but only as undocumented internal helper for ::tcl::Pkg::source. 2017-01-05 11:55:56 +00:00
fvogel 45db025684 Added more glob patterns in order to ignore html generated documentation and Windows-specific compilation products when running fossil extra 2017-01-04 16:34:03 +00:00
jan.nijtmans 5e02396d5e In stead of "source -nopkg" use a ::tcl::Pkg::source utility function. 2017-01-04 16:23:23 +00:00
jan.nijtmans 2e108cd831 Fix safe.tcl test-cases: "source -nopkg" is not necessary here: "source" is an alias for "::safe::AliasSource", which doesn't use "source" 2017-01-04 15:16:31 +00:00
jan.nijtmans 27fb8875b7 Merge trunk. First steps in eliminating "source -nopkg". Some test-cases still fail. 2017-01-04 14:05:20 +00:00
jan.nijtmans acdb5b2026 Fix 2 test-cases, due to changed command options. 2017-01-04 13:51:26 +00:00
jan.nijtmans f711652d04 TIP [http://www.tcl.tk/cgi-bin/tct/tip/459|459] implementation, but (for now) without the "source -nopkg" part. 2017-01-04 13:38:56 +00:00
jan.nijtmans ca2077254b TIP [http://www.tcl.tk/cgi-bin/tct/tip/456|456] implementation: Extend the C API to Support Passing Options to TCP Server Creation 2017-01-04 12:55:27 +00:00
jan.nijtmans 99fa27bc91 merge core-8-6-branch 2017-01-04 11:55:28 +00:00
limeboy a2c66d61f0 Make the code slightly more pleasing to the eyes. 2017-01-01 22:19:26 +00:00
jan.nijtmans aba0a7a6cd Make options -reuseaddr/-reuseport forbidden without -server, no matter the value being true or false. Some additional test-cases. 2016-12-20 12:35:33 +00:00
jan.nijtmans d97bb854b0 merge fork 2016-12-20 11:47:11 +00:00
limeboy f208386ff7 Decouple the switch handling. 2016-12-20 10:56:53 +00:00
limeboy e574cfbc71 Correct the handling of -server and its options. 2016-12-20 10:22:22 +00:00
jan.nijtmans 7a1d9d5758 merge trunk (still has test failure in socket.test) 2016-12-20 09:30:02 +00:00
limeboy dfbc8a6296 Update the documentation 2016-12-14 16:03:53 +00:00
limeboy cbe4a7dae5 Adjust OpenTcpServer for the latest changes to OpenTcpServerEx 2016-12-14 15:59:43 +00:00
limeboy caf8932e2e Fix for the argument parsing phase in the [socket] command. 2016-12-14 15:52:21 +00:00
limeboy 2e467a4c9a Make OpenTcpServerEx accept a 'service' string parameter instead of a port. 2016-12-14 15:49:27 +00:00
jan.nijtmans 3df1a90364 Bring back stub table in original state.
Merge trunk
2016-12-08 17:52:36 +00:00
limeboy 13a4d32330 merge trunk 2016-12-01 12:01:01 +00:00
jan.nijtmans 804199d4b7 Implement the "package forget" part, which was still missing. Handle the case that a filename contains spaces. 2016-11-29 09:45:20 +00:00
jan.nijtmans 1df184e860 slightly simpler 2016-11-28 15:29:36 +00:00
jan.nijtmans b7e862c565 Complete implementation, tests and documentation 2016-11-28 13:17:47 +00:00
jan.nijtmans ee6806b80d Add "package files" testcase, which doesn give the right answer. So still work to do 2016-11-26 17:47:27 +00:00
dkf cdb6b73776 Implementation of improved notifier from Lucio Andrés Illanes Albornoz. 2016-11-25 15:44:43 +00:00
jan.nijtmans ecda933dfc Merge trunk.
Implementation looks complete. Still missing: test-cases and documentation.
2016-11-25 15:06:13 +00:00
limeboy 8fe50e3f91 Windows support and minor touchups to the documentation. 2016-11-25 14:53:20 +00:00
limeboy 3d5c28f527 Minor documentation touchups. 2016-11-25 13:27:56 +00:00
jan.nijtmans 7a6b829025 Merge trunk, and fix two socket test-cases. 2016-11-25 09:38:04 +00:00
limeboy e123cfc452 Forgot a - in the parameters array. 2016-11-24 21:15:15 +00:00
limeboy 467b6eeb8e Allow a boolean argument to be passed. 2016-11-24 21:01:43 +00:00
jan.nijtmans 43f0f22700 merge trunk 2016-11-24 20:55:43 +00:00
limeboy 07020d6350 First round of documentation update. 2016-11-24 20:28:42 +00:00
jan.nijtmans 2cbc2f1993 merge fork 2016-11-24 16:21:20 +00:00
jan.nijtmans 1b0d436cc7 Starting implementing the "package files" command. TIP still to be written. 2016-11-24 16:20:05 +00:00
limeboy 15b2687d3c Adjust the tests and add a handful of new ones. 2016-11-24 15:00:36 +00:00
jan.nijtmans 842d6d00f1 Fix compile error if SO_REUSEPORT not supported. Put command options in alphabetical order 2016-11-24 13:18:10 +00:00
limeboy 1859293255 Implement the whole TIP 456 specification.
Also introduces the `-reuseaddr' and `-reuseport' options for the `socket'
command.
2016-11-24 12:47:21 +00:00
jan.nijtmans 32f810fc3b Fix indenting 2016-11-22 11:24:48 +00:00
jan.nijtmans 6989a199e7 Added stub entry for tip #456. Documentation and tests still missing. Doesn't conform to TIP yet. 2016-11-22 11:21:00 +00:00
jan.nijtmans ee70b22d59 This is patch.002 from ticket [0b9d3ba2ba3e1e3fc33c97d5a9fa7ef85d11a696|0b9d3ba2ba], as first start of tip-456 implementation 2016-11-22 10:06:18 +00:00
jan.nijtmans cdba31b9d5 merge trunk 2015-07-13 09:41:02 +00:00
jan.nijtmans bb504b06b4 merge trunk 2015-07-02 12:19:15 +00:00
jan.nijtmans 55717aeaea merge trunk 2015-07-02 12:10:35 +00:00
jan.nijtmans fad7a0e23d merge trunk 2014-07-31 08:39:50 +00:00
jan.nijtmans da7cc28446 Make sure the "sockettest" command is available even when running socket.test individually. 2014-07-18 10:00:52 +00:00
jan.nijtmans e6e391530f merge trunk 2014-07-18 07:32:43 +00:00
oehhar a0256cda63 Replaced option "-unsupported1" by test command "testsocket debugflags" (thanks Donal, Donald). 2014-07-17 09:53:36 +00:00
oehhar 85daeb5e16 Robust async connect tests by temporarely switching off auto continuation. Ticket [13d3af3ad5] 2014-06-05 19:09:51 +00:00
jan.nijtmans 8615597984 rebase TIP [http://tip.tcl.tk/425|425] implementation 2013-11-08 14:57:44 +00:00
jan.nijtmans a333bbaa12 rebase TIP [http://tip.tcl.tk/425|425] implementation 2013-08-19 09:10:36 +00:00
jan.nijtmans 2bc847ac57 rebase 2013-08-11 15:19:42 +00:00
jan.nijtmans 9283692888 rebase 2013-07-29 10:51:05 +00:00
jan.nijtmans 017b8b10b6 Fix Cygwin build: put Tcl_ConsolePanic in the stub library, not the dll. 2013-07-24 14:14:34 +00:00
jan.nijtmans 4ddfe70ae2 implement for Cygwin as well 2013-07-23 12:42:52 +00:00
jan.nijtmans 53dc25e532 Add documentation 2013-07-23 11:54:49 +00:00
jan.nijtmans 542b57cf21 rebase 2013-07-23 10:57:22 +00:00
jan.nijtmans e36fd891e4 rebase 2013-06-27 09:07:04 +00:00
jan.nijtmans 954b241f34 rebase 2013-06-26 08:23:31 +00:00
jan.nijtmans 3f56494834 rebase 2013-06-18 09:52:53 +00:00
jan.nijtmans 6a811b97b9 rebase 2013-06-14 11:21:00 +00:00
jan.nijtmans 1900da6d24 rebase 2013-06-07 13:22:20 +00:00
jan.nijtmans 8f38d12eee TIP #414 implementation 2013-06-04 08:34:32 +00:00
jan.nijtmans 3f5f45f002 fix directory where tclWinPanic.c resides 2013-05-17 14:09:20 +00:00
jan.nijtmans e6528cb48d rebase 2013-05-17 07:36:01 +00:00
jan.nijtmans 041184928d rebase 2013-04-11 15:10:36 +00:00
jan.nijtmans b108063f75 rebase 2013-04-11 10:18:15 +00:00
jan.nijtmans 9ce336b3d1 rebase 2013-04-03 21:24:39 +00:00
jan.nijtmans b5da760544 rebase 2013-04-03 21:07:40 +00:00
jan.nijtmans 7e520e2089 rebase
increase limit to 26000 characters
2013-04-03 13:12:14 +00:00
jan.nijtmans 07af7d5337 better comments 2013-04-03 12:38:46 +00:00
jan.nijtmans 696a9ba3f9 Use Tcl_InitSubsystems in Tcl_Main macro 2013-04-01 21:48:51 +00:00
jan.nijtmans 9db6776dbe initsubsystems 2013-04-01 16:45:36 +00:00
jan.nijtmans 1c6a242b2e 2 lines not used any more 2013-03-31 22:09:40 +00:00
jan.nijtmans a58db736cf Fix Tcl_Main macro 2013-03-31 20:27:33 +00:00
jan.nijtmans 449ea43718 Going forward trying to define a better Tcl_InitStubsystems() 2013-03-31 20:17:46 +00:00
jan.nijtmans 260c2634b9 better leave tclPanic.c as it was 2013-03-31 19:32:57 +00:00
jan.nijtmans 6d0db57c02 Better Windows console panic proc, still to be TIPped. 2013-03-30 21:44:39 +00:00
dgp 11593d64b8 merge trunk so review patch/diff is smaller 2013-03-26 18:00:54 +00:00
jan.nijtmans e4a0b9dbfd Looks like TCL_INIT_CUSTOM (previously known as TCL_INIT_STUFF) is not a bad idea at all,
provided it has a Tcl_Interp* argument as well, so it can initialize the stub table.
A typedef for the function is not necessary, as a variable-argument function doesn't do any type checking. It's for the experienced developer anyway.
2013-03-26 15:57:45 +00:00
jan.nijtmans bb770e33f8 Add TCL_INIT_STUFF 2013-03-26 13:58:53 +00:00
jan.nijtmans d048128004 Version having TCL_INIT_PANIC as only Tcl_InitSubsystems() flag 2013-03-26 10:20:03 +00:00
jan.nijtmans eecece2afe TCL_INIT_ENCODINGPATH 2013-03-25 15:00:55 +00:00
jan.nijtmans 74c7068a25 merge trunk 2013-03-22 11:35:07 +00:00
jan.nijtmans 59360240b3 merge trunk 2013-03-06 13:38:05 +00:00
jan.nijtmans 91ba235b3c merge trunk.
Comment improvements, styling.
2013-02-23 20:16:30 +00:00
jan.nijtmans d13fe1e431 merge trunk.
Simplify dummy "interp" struct.
2013-02-23 11:19:13 +00:00
jan.nijtmans f361c1805c merge trunk.
doc improvements
2013-02-20 12:47:12 +00:00
jan.nijtmans 52b8ad45d1 Doc improvements.
Use freeProc field of pseudo interpreter to store the magic value.
2013-02-17 13:02:40 +00:00
jan.nijtmans 9b6c85d82e Merge trunk.
Move Tcl_InitSubsystems documentation to its own manpage
2013-02-15 10:29:05 +00:00
jan.nijtmans 88b8fc30a2 merge trunk 2013-02-14 10:11:58 +00:00
jan.nijtmans 1a0463ea04 merge trunk 2013-02-05 13:55:53 +00:00
jan.nijtmans cab91124b4 merge trunk 2013-02-04 22:58:38 +00:00
jan.nijtmans 8d9ea7c132 merge trunk 2013-02-03 16:07:32 +00:00
jan.nijtmans c5558280d7 merge trunk 2013-02-01 09:11:18 +00:00
jan.nijtmans 3913f5f7ae merge trunk 2013-01-26 17:04:32 +00:00
jan.nijtmans e8c69aa654 merge trunk
doc improvements
2013-01-26 00:45:01 +00:00
jan.nijtmans b2b37d97cf merge trunk 2013-01-25 13:12:01 +00:00
jan.nijtmans 4796adf5cb Another memory leak, and one Tcl_Free -> ckfree 2013-01-25 13:07:06 +00:00
jan.nijtmans 2c02c2ae5d Eliminate some unneeded usages of Tcl_SetResult, Tcl_AddObjErrorInfo
Fix "make test-packages" on cygwin
2013-01-25 11:45:17 +00:00
jan.nijtmans ef824b7395 merge trunk 2013-01-21 13:56:51 +00:00
jan.nijtmans 2930daf68c Implement TCL_INIT_CREATE_UTF8/TCL_INIT_CREATE_UNICODE 2013-01-10 09:23:39 +00:00
jan.nijtmans 0481e3ca74 New function Tcl_InitSubsystems, still to be TIP'ed 2013-01-09 10:30:00 +00:00
616 changed files with 51315 additions and 45778 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
----------------------
+54
View File
@@ -8830,3 +8830,57 @@ 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
2018-03-12 (TIP 490) add oo support for msgcat => msgcat 1.7.0 (oehlmann)
2018-03-12 (TIP 499) custom locale preference list (oehlmann)
=> msgcat 1.7.0
-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
+4 -4
View File
@@ -176,10 +176,10 @@ it is faster to execute the script directly.
.TP 23
\fBTCL_EVAL_GLOBAL\fR
.
If this flag is set, the script is processed at global level. This
means that it is evaluated in the global namespace and its variable
context consists of global variables only (it ignores any Tcl
procedures that are active).
If this flag is set, the script is evaluated in the global namespace instead of
the current namespace and its variable context consists of global variables
only (it ignores any Tcl procedures that are active).
.\" TODO: document TCL_EVAL_INVOKE and TCL_EVAL_NOERR.
.SH "MISCELLANEOUS DETAILS"
.PP
+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
+76 -168
View File
@@ -1,5 +1,6 @@
.\"
.\" Copyright (c) 2008 by Kevin B. Kenny.
.\" Copyright (c) 2018 by Nathan Coulter.
.\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -38,43 +39,39 @@ void
.SH ARGUMENTS
.AS Tcl_CmdDeleteProc *interp in
.AP Tcl_Interp *interp in
Interpreter in which to create or evaluate a command.
The relevant Interpreter.
.AP char *cmdName in
Name of a new command to create.
Name of the command to create.
.AP Tcl_ObjCmdProc *proc in
Implementation of a command that will be called whenever \fIcmdName\fR
is invoked as a command in the unoptimized way.
Called in order to evaluate a command. Is often just a small wrapper that uses
\fBTcl_NRCallObjProc\fR to call \fInreProc\fR using a new trampoline. Behaves
in the same way as the \fIproc\fR argument to \fBTcl_CreateObjCommand\fR(3)
(\fIq.v.\fR).
.AP Tcl_ObjCmdProc *nreProc in
Implementation of a command that will be called whenever \fIcmdName\fR
is invoked and requested to conserve the C stack.
Called instead of \fIproc\fR when a trampoline is already in use.
.AP ClientData clientData in
Arbitrary one-word value that will be passed to \fIproc\fR, \fInreProc\fR,
\fIdeleteProc\fR and \fIobjProc\fR.
Arbitrary one-word value passed to \fIproc\fR, \fInreProc\fR, \fIdeleteProc\fR
and \fIobjProc\fR.
.AP Tcl_CmdDeleteProc *deleteProc in/out
Procedure to call before \fIcmdName\fR is deleted from the interpreter.
This procedure allows for command-specific cleanup. If \fIdeleteProc\fR
is \fBNULL\fR, then no procedure is called before the command is deleted.
Called before \fIcmdName\fR is deleted from the interpreter, allowing for
command-specific cleanup. May be NULL.
.AP int objc in
Count of parameters provided to the implementation of a command.
Number of items in \fIobjv\fR.
.AP Tcl_Obj **objv in
Pointer to an array of Tcl values. Each value holds the value of a
single word in the command to execute.
Words in the command.
.AP Tcl_Obj *objPtr in
Pointer to a Tcl_Obj whose value is a script or expression to execute.
A script or expression to evaluate.
.AP int flags in
ORed combination of flag bits that specify additional options.
\fBTCL_EVAL_GLOBAL\fR is the only flag that is currently supported.
.\" TODO: This is a lie. But kbk didn't grasp TCL_EVAL_INVOKE and
.\" TCL_EVAL_NOERR well enough to document them.
As described for \fITcl_EvalObjv\fR.
.PP
.AP Tcl_Command cmd in
Token for a command that is to be used instead of the currently
executing command.
Token to use instead of one derived from the first word of \fIobjv\fR in order
to evaluate a command.
.AP Tcl_Obj *resultPtr out
Pointer to an unshared Tcl_Obj where the result of expression
evaluation is written.
Pointer to an unshared Tcl_Obj where the result of the evaluation is stored if
the return code is TCL_OK.
.AP Tcl_NRPostProc *postProcPtr in
Pointer to a function that will be invoked when the command currently
executing in the interpreter designated by \fIinterp\fR completes.
A function to push.
.AP ClientData data0 in
.AP ClientData data1 in
.AP ClientData data2 in
@@ -84,98 +81,51 @@ to the function designated by \fIpostProcPtr\fR when it is invoked.
.BE
.SH DESCRIPTION
.PP
This series of C functions provides an interface whereby commands that
are implemented in C can be evaluated, and invoke Tcl commands scripts
and scripts, without consuming space on the C stack. The non-recursive
evaluation is done by installing a \fItrampoline\fR, a small piece of
code that invokes a command or script, and then executes a series of
callbacks when the command or script returns.
These functions provide an interface to the function stack that an interpreter
iterates through to evaluate commands. The routine behind a command is
implemented by an initial function and any additional functions that the
routine pushes onto the stack as it progresses. The interpreter itself pushes
functions onto the stack to react to the end of a routine and to exercise other
forms of control such as switching between in-progress stacks and the
evaluation of other scripts at additional levels without adding frames to the C
stack. To execute a routine, the initial function for the routine is called
and then a small bit of code called a \fItrampoline\fR iteratively takes
functions off the stack and calls them, using the value of the last call as the
value of the routine.
.PP
The \fBTcl_NRCreateCommand\fR function creates a Tcl command in the
interpreter designated by \fIinterp\fR that is prepared to handle
nonrecursive evaluation with a trampoline. The \fIcmdName\fR argument
gives the name of the new command. If \fIcmdName\fR contains any
namespace qualifiers, then the new command is added to the specified
namespace; otherwise, it is added to the global namespace. \fIproc\fR
gives the procedure that will be called when the interpreter wishes to
evaluate the command in an unoptimized manner, and \fInreProc\fR is
the procedure that will be called when the interpreter wishes to
evaluate the command using a trampoline. \fIdeleteProc\fR is a
function that will be called before the command is deleted from the
interpreter. When any of the three functions is invoked, it is passed
the \fIclientData\fR parameter.
\fBTcl_NRCallObjProc\fR calls \fInreProc\fR using a new trampoline.
.PP
\fBTcl_NRCreateCommand\fR deletes any existing command
\fIname\fR already associated with the interpreter
(however see below for an exception where the existing command
is not deleted).
It returns a token that may be used to refer
to the command in subsequent calls to \fBTcl_GetCommandName\fR.
If \fBTcl_NRCreateCommand\fR is called for an interpreter that is in
the process of being deleted, then it does not create a new command,
does not delete any existing command of the same name, and returns NULL.
\fBTcl_NRCreateCommand\fR, an alternative to \fBTcl_CreateObjCommand\fR,
resolves \fIcmdName\fR, which may contain namespace qualifiers, relative to the
current namespace, creates a command by that name, and returns a token for the
command which may be used in subsequent calls to \fBTcl_GetCommandName\fR.
Except for a few cases noted below any existing command by the same name is
first deleted. If \fIinterp\fR is in the process of being deleted
\fBTcl_NRCreateCommand\fR does not create any command, does not delete any
command, and returns NULL.
.PP
The \fIproc\fR and \fInreProc\fR function are expected to conform to
all the rules set forth for the \fIproc\fR argument to
\fBTcl_CreateObjCommand\fR(3) (\fIq.v.\fR).
\fBTcl_NREvalObj\fR pushes a function that is like \fBTcl_EvalObjEx\fR but
consumes no space on the C stack.
.PP
When a command that is written to cope with evaluation via trampoline
is invoked without a trampoline on the stack, it will usually respond
to the invocation by creating a trampoline and calling the
trampoline-enabled implementation of the same command. This call is done by
means of \fBTcl_NRCallObjProc\fR. In the call to
\fBTcl_NRCallObjProc\fR, the \fIinterp\fR, \fIclientData\fR,
\fIobjc\fR and \fIobjv\fR parameters should be the same ones that were
passed to \fIproc\fR. The \fInreProc\fR parameter should designate the
trampoline-enabled implementation of the command.
\fBTcl_NREvalObjv\fR pushes a function that is like \fBTcl_EvalObjv\fR but
consumes no space on the C stack.
.PP
\fBTcl_NREvalObj\fR arranges for the script contained in \fIobjPtr\fR
to be evaluated in the interpreter designated by \fIinterp\fR after
the current command (which must be trampoline-enabled) returns. It is
the method by which a command may invoke a script without consuming
space on the C stack. Similarly, \fBTcl_NREvalObjv\fR arranges to
invoke a single Tcl command whose words have already been separated
and substituted. The \fIobjc\fR and \fIobjv\fR parameters give the
words of the command to be evaluated when execution reaches the
trampoline.
\fBTcl_NRCmdSwap\fR is like \fBTcl_NREvalObjv\fR, but uses \fIcmd\fR, a token
previously returned by \fBTcl_CreateObjCommand\fR or
\fBTcl_GetCommandFromObj\fR, instead of resolving the first word of \fIobjv\fR.
. The name of this command must be the same as \fIobjv[0]\fR.
.PP
\fBTcl_NRCmdSwap\fR allows for trampoline evaluation of a command whose
resolution is already known. The \fIcmd\fR parameter gives a
\fBTcl_Command\fR token (returned from \fBTcl_CreateObjCommand\fR or
\fBTcl_GetCommandFromObj\fR) identifying the command to be invoked in
the trampoline; this command must match the word in \fIobjv[0]\fR.
The remaining arguments are as for \fBTcl_NREvalObjv\fR.
\fBTcl_NRExprObj\fR pushes a function that evaluates \fIobjPtr\fR as an
expression in the same manner as \fBTcl_ExprObj\fR but without consuming space
on the C stack.
.PP
\fBTcl_NREvalObj\fR, \fBTcl_NREvalObjv\fR and \fBTcl_NRCmdSwap\fR
all accept a \fIflags\fR parameter, which is an OR-ed-together set of
bits to control evaluation. At the present time, the only supported flag
available to callers is \fBTCL_EVAL_GLOBAL\fR.
.\" TODO: Again, this is a lie. Do we want to explain TCL_EVAL_INVOKE
.\" and TCL_EVAL_NOERR?
If the \fBTCL_EVAL_GLOBAL\fR flag is set, the script or command is
evaluated in the global namespace. If it is not set, it is evaluated
in the current namespace.
All of the functions return \fBTCL_OK\fR if the evaluation of the script,
command, or expression has been scheduled successfully. Otherwise (for example
if the command name cannot be resolved), they return \fBTCL_ERROR\fR and store
a message as the interpreter's result.
.PP
\fBTcl_NRExprObj\fR arranges for the expression contained in \fIobjPtr\fR
to be evaluated in the interpreter designated by \fIinterp\fR after
the current command (which must be trampoline-enabled) returns. It is
the method by which a command may evaluate a Tcl expression without consuming
space on the C stack. The argument \fIresultPtr\fR is a pointer to an
unshared Tcl_Obj where the result of expression evaluation is to be written.
If expression evaluation returns any code other than TCL_OK, the
\fIresultPtr\fR value is left untouched.
.PP
All of the routines return \fBTCL_OK\fR if command or expression invocation
has been scheduled successfully. If for any reason the scheduling cannot
be completed (for example, if the interpreter is unable to find
the requested command), they return \fBTCL_ERROR\fR with an
appropriate message left in the interpreter's result.
.PP
\fBTcl_NRAddCallback\fR arranges to have a C function called when the
current trampoline-enabled command in the Tcl interpreter designated
by \fIinterp\fR returns. The \fIpostProcPtr\fR argument is a pointer
to the callback function, which must have arguments and return value
consistent with the \fBTcl_NRPostProc\fR data type:
\fBTcl_NRAddCallback\fR pushes \fIpostProcPtr\fR. The signature for
\fBTcl_NRPostProc\fR is:
.PP
.CS
typedef int
@@ -185,25 +135,13 @@ typedef int
int \fIresult\fR);
.CE
.PP
When the trampoline invokes the callback function, the \fIdata\fR
parameter will point to an array containing the four one-word
quantities that were passed to \fBTcl_NRAddCallback\fR in the
\fIdata0\fR through \fIdata3\fR parameters. The Tcl interpreter will
be designated by the \fIinterp\fR parameter, and the \fIresult\fR
parameter will contain the result (\fBTCL_OK\fR, \fBTCL_ERROR\fR,
\fBTCL_RETURN\fR, \fBTCL_BREAK\fR or \fBTCL_CONTINUE\fR) that was
returned by the command evaluation. The callback function is expected,
in turn, either to return a \fIresult\fR to control further evaluation.
.PP
Multiple \fBTcl_NRAddCallback\fR invocations may request multiple
callbacks, which may be to the same or different callback
functions. If multiple callbacks are requested, they are executed in
last-in, first-out order, that is, the most recently requested
callback is executed first.
\fIdata\fR is a pointer to an array containing \fIdata0\fR through \fIdata3\fR.
\fIresult\fR is the value returned by the previous function implementing part
the routine.
.SH EXAMPLE
.PP
The usual pattern for Tcl commands that invoke other Tcl commands
is something like:
The following command uses \fBTcl_EvalObjEx\fR, which consumes space on the C
stack, to evalute a script:
.PP
.CS
int
@@ -228,28 +166,17 @@ int
\fITheCmdOldObjProc\fR, clientData, TheCmdDeleteProc);
.CE
.PP
To enable a command like this one for trampoline-based evaluation,
it must be split into three pieces:
.IP \(bu
A non-trampoline implementation, \fITheCmdNewObjProc\fR,
which will simply create a trampoline
and invoke the trampoline-based implementation.
.IP \(bu
A trampoline-enabled implementation, \fITheCmdNRObjProc\fR. This
function will perform the initialization, request that the trampoline
call the postprocessing routine after command evaluation, and finally,
request that the trampoline call the inner command.
.IP \(bu
A postprocessing routine, \fITheCmdPostProc\fR. This function will
perform the postprocessing formerly done after the return from the
inner command in \fITheCmdObjProc\fR.
.PP
The non-trampoline implementation is simple and stylized, containing
a single statement:
To avoid consuming space on the C stack, \fITheCmdOldObjProc\fR is renamed to
\fITheCmdNRObjProc\fR and the postprocessing step is split into a separate
function, \fITheCmdPostProc\fR, which is pushed onto the function stack.
\fITcl_EvalObjEx\fR is replaced with \fITcl_NREvalObj\fR, which uses a
trampoline instead of consuming space on the C stack. A new version of
\fITheCmdOldObjProc\fR is just a a wrapper that uses \fBTcl_NRCallObjProc\fR to
call \fITheCmdNRObjProc\fR:
.PP
.CS
int
\fITheCmdNewObjProc\fR(
\fITheCmdOldObjProc\fR(
ClientData clientData,
Tcl_Interp *interp,
int objc,
@@ -260,9 +187,6 @@ int
}
.CE
.PP
The trampoline-enabled implementation requests postprocessing,
and returns to the trampoline requesting command evaluation.
.PP
.CS
int
\fITheCmdNRObjProc\fR
@@ -284,9 +208,6 @@ int
}
.CE
.PP
The postprocessing procedure does whatever the original command did
upon return from the inner evaluation.
.PP
.CS
int
\fITheCmdNRPostProc\fR(
@@ -303,26 +224,13 @@ int
}
.CE
.PP
If \fItheCommand\fR is a command that results in multiple commands or
scripts being evaluated, its postprocessing routine may schedule
additional postprocessing and then request another command evaluation
by means of \fBTcl_NREvalObj\fR or one of the other evaluation
routines. Looping and sequencing constructs may be implemented in this way.
Any function comprising a routine can push other functions, making it possible
implement looping and sequencing constructs using the function stack.
.PP
Finally, to install a trampoline-enabled command in the interpreter,
\fBTcl_NRCreateCommand\fR is used in place of
\fBTcl_CreateObjCommand\fR. It accepts two command procedures instead
of one. The first is for use when no trampoline is yet on the stack,
and the second is for use when there is already a trampoline in place.
.PP
.CS
\fBTcl_NRCreateCommand\fR(interp, "theCommand",
\fITheCmdNewObjProc\fR, \fITheCmdNRObjProc\fR, clientData,
TheCmdDeleteProc);
.CE
.SH "SEE ALSO"
Tcl_CreateCommand(3), Tcl_CreateObjCommand(3), Tcl_EvalObjEx(3), Tcl_GetCommandFromObj(3), Tcl_ExprObj(3)
.SH KEYWORDS
stackless, nonrecursive, execute, command, global, value, result, script
.SH COPYRIGHT
Copyright (c) 2008 by Kevin B. Kenny
Copyright (c) 2008 by Kevin B. Kenny.
Copyright (c) 2018 by Nathan Coulter.
+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
+12 -1
View File
@@ -7,7 +7,7 @@
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
Tcl_Panic, Tcl_PanicVA, Tcl_SetPanicProc \- report fatal error and abort
Tcl_Panic, Tcl_PanicVA, Tcl_SetPanicProc, Tcl_ConsolePanic \- report fatal error and abort
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -21,6 +21,9 @@ void
void
\fBTcl_SetPanicProc\fR(\fIpanicProc\fR)
.sp
void
\fBTcl_ConsolePanic\fR(\fIformat\fR, \fIarg\fR, \fIarg\fR, \fI...\fR)
.sp
.SH ARGUMENTS
.AS Tcl_PanicProc *panicProc
.AP "const char*" format in
@@ -54,6 +57,14 @@ message is sent to the debugger in stead. If the windows executable
does not have a stderr channel (e.g. \fBwish.exe\fR), then a
system dialog box is used to display the panic message.
.PP
If your application doesn't use \fBTcl_Main\fR or \fBTk_Main\fR
and you want to implicitly use the stderr channel of your
application's C runtime (in stead of the stderr channel of the
C runtime used by Tcl), you can call \fBTcl_SetPanicProc\fR
with \fBTcl_ConsolePanic\fR as its argument. On platforms which
only have one C runtime (almost all platforms except Windows)
\fBTcl_ConsolePanic\fR is equivalent to NULL.
.PP
\fBTcl_SetPanicProc\fR may be used to modify the behavior of
\fBTcl_Panic\fR. The \fIpanicProc\fR argument should match the
type \fBTcl_PanicProc\fR:
+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
+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
+23 -8
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 and \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
@@ -169,7 +174,7 @@ for \fBx\fR and
for \fBX\fR).
.TP 10
\fBb\fR
Convert integer to binary string, using digits 0 and 1.
Convert integer to unsigned binary string, using digits 0 and 1.
.TP 10
\fBc\fR
Convert integer to the Unicode character it represents.
@@ -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
+20
View File
@@ -148,6 +148,19 @@ or \fB\-not\fR.
These options are used to search lists of lists. They may be used
with any other options.
.TP
\fB\-stride\0\fIstrideLength\fR
.
If this option is specified, the list is treated as consisting of
groups of \fIstrideLength\fR elements and the groups are searched by
either their first element or, if the \fB\-index\fR option is used,
by the element within each group given by the first index passed to
\fB\-index\fR (which is then ignored by \fB\-index\fR). The resulting
index always points to the first element in a group.
.PP
The list length must be an integer multiple of \fIstrideLength\fR, which
in turn must be at least 1. A \fIstrideLength\fR of 1 is the default and
indicates no grouping.
.TP
\fB\-index\fR\0\fIindexList\fR
.
This option is designed for use when searching within nested lists.
@@ -208,6 +221,13 @@ It is also possible to search inside elements:
\fBlsearch\fR -index 1 -all -inline {{a abc} {b bcd} {c cde}} *bc*
\fI\(-> {a abc} {b bcd}\fR
.CE
.PP
The same thing for a flattened list:
.PP
.CS
\fBlsearch\fR -stride 2 -index 1 -all -inline {a abc b bcd c cde} *bc*
\fI\(-> {a abc b bcd}\fR
.CE
.SH "SEE ALSO"
foreach(n), list(n), lappend(n), lindex(n), linsert(n), llength(n),
lset(n), lsort(n), lrange(n), lreplace(n),
+178 -27
View File
@@ -11,9 +11,9 @@
.SH NAME
msgcat \- Tcl message catalog
.SH SYNOPSIS
\fBpackage require Tcl 8.5\fR
\fBpackage require Tcl 8.7\fR
.sp
\fBpackage require msgcat 1.6\fR
\fBpackage require msgcat 1.7\fR
.sp
\fB::msgcat::mc \fIsrc-string\fR ?\fIarg arg ...\fR?
.sp
@@ -23,9 +23,15 @@ msgcat \- Tcl message catalog
\fB::msgcat::mcexists\fR ?\fB-exactnamespace\fR? ?\fB-exactlocale\fR? \fIsrc-string\fR
.VE "TIP 412"
.sp
.VS "TIP 490"
\fB::msgcat::mcpackagenamespaceget\fR
.VE "TIP 490"
.sp
\fB::msgcat::mclocale \fR?\fInewLocale\fR?
.sp
\fB::msgcat::mcpreferences\fR
.VS "TIP 499"
\fB::msgcat::mcpreferences\fR ?\fIlocale preference\fR? ...
.VE "TIP 499"
.sp
.VS "TIP 412"
\fB::msgcat::mcloadedlocales subcommand\fR ?\fIlocale\fR?
@@ -50,6 +56,10 @@ msgcat \- Tcl message catalog
.sp
\fB::msgcat::mcforgetpackage\fR
.VE "TIP 412"
.sp
.VS "TIP 499"
\fB::msgcat::mcutil subcommand\fR ?\fIlocale\fR?
.VS "TIP 499"
.BE
.SH DESCRIPTION
.PP
@@ -71,6 +81,11 @@ In \fBmsgcat\fR, there is a global locale initialized by the system locale of th
Each package may decide to use the global locale or to use a package specific locale.
.PP
The global locale may be changed on demand, for example by a user initiated language change or within a multi user application like a web server.
.PP
.VS tip490
Object oriented programming is supported by the use of a package namespace.
.VE tip490
.PP
.SH COMMANDS
.TP
\fB::msgcat::mc \fIsrc-string\fR ?\fIarg arg ...\fR?
@@ -95,6 +110,17 @@ use the result. If an application is written for a single language in
this fashion, then it is easy to add support for additional languages
later simply by defining new message catalog entries.
.RE
.VS "TIP 490"
.TP
\fB::msgcat::mcn \fInamespace\fR \fIsrc-string\fR ?\fIarg arg ...\fR?
.
Like \fB::msgcat::mc\fR, but with the message namespace specified as first argument.
.PP
.RS
\fBmcn\fR may be used for cases where the package namespace is not the namespace of the caller.
An example is shown within the description of the command \fB::msgcat::mcpackagenamespaceget\fR below.
.RE
.PP
.TP
\fB::msgcat::mcmax ?\fIsrc-string src-string ...\fR?
.
@@ -103,28 +129,68 @@ of the longest translated string. This is useful when designing
localized GUIs, which may require that all buttons, for example, be a
fixed width (which will be the width of the widest button).
.TP
\fB::msgcat::mcexists\fR ?\fB-exactnamespace\fR? ?\fB-exactlocale\fR? \fIsrc-string\fR
.
.VS "TIP 412"
\fB::msgcat::mcexists\fR ?\fB-exactnamespace\fR? ?\fB-exactlocale\fR? ?\fB-namespace\fR \fInamespace\fR? \fIsrc-string\fR
.
Return true, if there is a translation for the given \fIsrc-string\fR.
.PP
.RS
The search may be limited by the option \fB\-exactnamespace\fR to only check the current namespace and not any parent namespaces.
.PP
It may also be limited by the option \fB\-exactlocale\fR to only check the first prefered locale (e.g. first element returned by \fB::msgcat::mcpreferences\fR if global locale is used).
.RE
.PP
.VE "TIP 412"
.VS "TIP 490"
An explicit package namespace may be specified by the option \fB-namespace\fR.
The namespace of the caller is used if not explicitly specified.
.RE
.PP
.VE "TIP 490"
.VS "TIP 490"
.TP
\fB::msgcat::mcpackagenamespaceget\fR
.
Return the package namespace of the caller.
This command handles all cases described in section \fBOBJECT ORIENTED PROGRAMMING\fR.
.PP
.RS
Example usage is a tooltip package, which saves the caller package namespace to update the translation each time the tooltip is shown:
.CS
proc ::tooltip::tooltip {widget message} {
...
set messagenamespace [uplevel 1 {::msgcat::mcpackagenamespaceget}]
...
bind $widget [list ::tooltip::show $widget $messagenamespace $message]
}
proc ::tooltip::show {widget messagenamespace message} {
...
set message [::msgcat::mcn $messagenamespace $message]
...
}
.CE
.RE
.PP
.VE "TIP 490"
.TP
\fB::msgcat::mclocale \fR?\fInewLocale\fR?
.
This function sets the locale to \fInewLocale\fR. If \fInewLocale\fR
is omitted, the current locale is returned, otherwise the current locale
is set to \fInewLocale\fR. msgcat stores and compares the locale in a
If \fInewLocale\fR is omitted, the current locale is returned, otherwise the current locale
is set to \fInewLocale\fR.
.PP
.RS
If the new locale is set to \fInewLocale\fR, the corresponding preferences are calculated and set.
For example, if the current locale is en_US_funky, then \fB::msgcat::mcpreferences\fR returns \fB{en_us_funky en_us en {}}\fR.
.PP
The same result may be acheved by \fB::msgcat::mcpreferences\fR {*}[\fB::msgcat::mcutil getpreferences\fR \fInewLocale\fR].
.PP
The current locale is always the first element of the list returned by \fBmcpreferences\fR.
.PP
msgcat stores and compares the locale in a
case-insensitive manner, and returns locales in lowercase.
The initial locale is determined by the locale specified in
the user's environment. See \fBLOCALE SPECIFICATION\fR
below for a description of the locale string format.
.RS
.PP
.VS "TIP 412"
If the locale is set, the preference list of locales is evaluated.
@@ -132,16 +198,26 @@ Locales in this list are loaded now, if not jet loaded.
.VE "TIP 412"
.RE
.TP
\fB::msgcat::mcpreferences\fR
\fB::msgcat::mcpreferences\fR ?\fIlocale preference\fR? ...
.
Returns an ordered list of the locales preferred by
the user, based on the user's language specification.
The list is ordered from most specific to least
preference. The list is derived from the current
locale set in msgcat by \fB::msgcat::mclocale\fR, and
cannot be set independently. For example, if the
current locale is en_US_funky, then \fB::msgcat::mcpreferences\fR
returns \fB{en_us_funky en_us en {}}\fR.
Without arguments, returns an ordered list of the locales preferred by
the user.
The list is ordered from most specific to least preference.
.PP
.VS "TIP 499"
.RS
A set of locale preferences may be given to set the list of locale preferences.
The current locale is also set, which is the first element of the locale preferences list.
.PP
Locale preferences are loaded now, if not jet loaded.
.PP
As an example, the user may prefer French or English text. This may be configured by:
.CS
::msgcat::mcpreferences fr en {}
.CE
.RE
.PP
.VS "TIP 499"
.TP
\fB::msgcat:mcloadedlocales subcommand\fR ?\fIlocale\fR?
.
@@ -232,6 +308,22 @@ Note that this routine is only called if the concerned package did not set a pac
The calling package clears all its state within the \fBmsgcat\fR package including all settings and translations.
.VE "TIP 412"
.PP
.VS "TIP 499"
.TP
\fB::msgcat::mcutil getpreferences\fR \fIlocale\fR
.
Return the preferences list of the given locale as described in section \fBLOCALE SPECIFICATION\fR.
An example is the composition of a preference list for the bilingual region "Biel/Bienne" as a concatenation of swiss german and swiss french:
.CS
% concat [lrange [msgcat::mcutil getpreferences fr_CH] 0 end-1] [msgcat::mcutil getpreferences de_CH]
fr_ch fr de_ch de {}
.CE
.TP
\fB::msgcat::mcutil getsystemlocale\fR
.
The system locale is returned as described by the section \fBLOCALE SPECIFICATION\fR.
.VE "TIP 499"
.PP
.SH "LOCALE SPECIFICATION"
.PP
The locale is specified to \fBmsgcat\fR by a locale string
@@ -437,7 +529,7 @@ formatting substitution is done directly.
# human-oriented versions by \fBmsgcat::mcset\fR
.CE
.VS "TIP 412"
.SH Package private locale
.SH "PACKAGE PRIVATE LOCALE"
.PP
A package using \fBmsgcat\fR may choose to use its own package private
locale and its own set of loaded locales, independent to the global
@@ -461,10 +553,22 @@ This command may cause the load of locales.
.
Return the package private locale or the global locale, if no package private locale is set.
.TP
\fB::msgcat::mcpackagelocale preferences\fR
\fB::msgcat::mcpackagelocale preferences\fR ?\fIlocale preference\fR? ...
.
Return the package private preferences or the global preferences,
With no parameters, return the package private preferences or the global preferences,
if no package private locale is set.
The package locale state (set or not) is not changed (in contrast to the command \fB::msgcat::mcpackagelocale set\fR).
.PP
.RS
.VS "TIP 499"
If a set of locale preferences is given, it is set as package locale preference list.
The package locale is set to the first element of the preference list.
A package locale is activated, if it was not set so far.
.PP
Locale preferences are loaded now for the package, if not jet loaded.
.VE "TIP 499"
.RE
.PP
.TP
\fB::msgcat::mcpackagelocale loaded\fR
.
@@ -488,7 +592,7 @@ Returns true, if the given locale is loaded for the package.
.
Clear any loaded locales of the package not present in the package preferences.
.PP
.SH Changing package options
.SH "CHANGING PACKAGE OPTIONS"
.PP
Each package using msgcat has a set of options within \fBmsgcat\fR.
The package options are described in the next sectionPackage options.
@@ -563,7 +667,7 @@ A generic unknown handler is used if set to the empty string. This consists in r
See section \fBcallback invocation\fR below.
The appended arguments are identical to \fB::msgcat::mcunknown\fR.
.RE
.SS Callback invocation
.SH "Callback invocation"
A package may decide to register one or multiple callbacks, as described above.
.PP
Callbacks are invoked, if:
@@ -577,7 +681,54 @@ Callbacks are invoked, if:
If a called routine fails with an error, the \fBbgerror\fR routine for the interpreter is invoked after command completion.
Only exception is the callback \fBunknowncmd\fR, where an error causes the invoking \fBmc\fR-command to fail with that error.
.PP
.SS Examples
.VS tip490
.SH "OBJECT ORIENTED PROGRAMMING"
\fBmsgcat\fR supports packages implemented by object oriented programming.
Objects and classes should be defined within a package namespace.
.PP
There are 3 supported cases where package namespace sensitive commands of msgcat (\fBmc\fR, \fBmcexists\fR, \fBmcpackagelocale\fR, \fBmcforgetpackage\fR, \fBmcpackagenamespaceget\fR, \fBmcpackageconfig\fR, \fBmcset\fR and \fBmcmset\fR) may be called:
.PP
.TP
\fB1) In class definition script\fR
.
\fBmsgcat\fR command is called within a class definition script.
.CS
namespace eval ::N2 {
mcload $dir/msgs
oo::class create C1 {puts [mc Hi!]}
}
.CE
.PP
.TP
\fB2) method defined in a class\fR
.
\fBmsgcat\fR command is called from a method in an object and the method is defined in a class.
.CS
namespace eval ::N3Class {
mcload $dir/msgs
oo::class create C1
oo::define C1 method m1 {
puts [mc Hi!]
}
}
.CE
.PP
.TP
\fB3) method defined in a classless object\fR
.
\fBmsgcat\fR command is called from a method of a classless object.
.CS
namespace eval ::N4 {
mcload $dir/msgs
oo::object create O1
oo::objdefine O1 method m1 {} {
puts [mc Hi!]
}
}
.CE
.PP
.VE tip490
.SH EXAMPLES
Packages which display a GUI may update their widgets when the global locale changes.
To register to a callback, use:
.CS
@@ -643,9 +794,9 @@ proc ::tcl::clock::LocalizeFormat { locale format } {
.PP
The message catalog code was developed by Mark Harrison.
.SH "SEE ALSO"
format(n), scan(n), namespace(n), package(n)
format(n), scan(n), namespace(n), package(n), oo::class(n), oo::object
.SH KEYWORDS
internationalization, i18n, localization, l10n, message, text, translation
internationalization, i18n, localization, l10n, message, text, translation, class, object
.\" Local Variables:
.\" mode: nroff
.\" End:
+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

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