** Attributes ** nick: PYK name: Nathan Coulter ethereum wallet: 0x0b5049C148b00a216B29641ab16953b6060Ef8A6 website: http://www.pooryorick.com%|%website editors: [vim] , [emacs] contact: t k dot t c l dot w i k i at p o o r y o r i c k dot c o m wikipedia user page: https://en.wikipedia.org/wiki/User:Pooryorick~enwiki Tcl theme song nominee: [https://www.youtube.com/watch?v=G74XPn4F6_c%|%Who Do You Want To Be ?] -- get your [shimmering%|%shimmer] on ! slogan: "If something is worth doing , it's worth doing right ." slogan: "Hang the sense of it all and keep yourself occupied ." slogan: `return -level 0 {*}[[yieldto return -level 0]]` ** Presence ** [https://en.wikipedia.org/wiki/User:Pooryorick~enwiki%|%wikipedia]: [https://stackoverflow.com/users/2723962/poor-yorick%|%stackoverflow]: [https://unix.stackexchange.com/users/24023/pooryorick%|%stackexchange]: [https://superuser.com/users/161618/pooryorick%|%superuser]: [https://serverfault.com/users/139000/pooryorick%|%serverfault]: ** Tcl Events Attended ** [Eighteenth Annual Tcl/Tk Conference (2011)]: [Nineteenth Annual Tcl/Tk Conference (2012)]: [Twentieth Annual Tcl/Tk Conference (2013)]: [Twenty-first Annual Tcl/Tk Conference (2014)]: [13th European Tcl/Tk Users Meeting 2015]: [Twenty-second Annual Tcl/Tk Conference (2015)]: [14th European Tcl/Tk Users Meeting 2016]: [Twenty-third Annual Tcl/Tk Conference (2016)]: [15th European Tcl/Tk Users Meeting 2017]: [Twenty-fourth Annual Tcl/Tk Conference (2017)]: [16th European Tcl/Tk Users Meeting 2018]: [Twenty-fifth Annual Tcl/Tk Conference (2018)]: ** FAQ ** '''What's up with the weird punctuation on this page ?''': I think it looks more balanced and flows better . I think it's beautiful . It calms me . Maybe I picked it up from Chinese texts . ** Tcl Thoughts ** Tcl started off with an ingeniously simple and regular syntax , and has consistently followed through with a knack for exposing just the right foundational capabilities without overbuilding the language . Tcl attracts engineering types who already know how to build things , and provides a helpful toolset rather than a framework one would have to work around . If [Guido van Rossum%|%Guido] has a time machine , then the [Tcl Core Team] has a timeless machine . ** Expectations ** Here are my guidelines for editing this wiki . I'm not sure how representative it is of the expectations and guidelines of other editors , so feel free to edit , annotate , and express your opinion and make suggestions regarding these guidelines , particularly if they've caused you any discomfort as an editor yourself . * This wiki is a resource for the community , and all content is subject to editing by anyone . * This wiki aims to be comprehensive , but it does not aim to be just an encyclopedia . * This wiki is not an official reference . * This wiki is not a source code management system . * It isn't necessary to have a Ph.D. in computer science to contribute . * No individual owns any page , not even their namesake page . ([MJ]: it's true) * A page can be as trivial or as complex as one desires . * There is a lot of room on this wiki , and there is room for content of varying quality . More frequently-visited pages are held to a higher standard . Content not meeting that standard may be moved off to less-frequented page . * This wiki tries to find a balance between the single coherent narrative of consensus and the chaos of discussion and individual presentation . The primary strategy to achieve this is to keep each page true to the measure of its creation , often by migrating some content to other pages . Organization and reorganization are constant activities and part of every contributor's duty . * Like [http://en.wikipedia.org/wiki/Ethernet%|%ethernet] , a wiki is intrinsically contention-based . A contributor should be ready and willing to take the time necessary to defend their position . * Collaborative editing can require extreme patience and indulgence . A contributor should meet unwelcome edits with a good nature and a willingness to engage in the game . It's almost always best to resist the temptation to take offense at other contributors . There is usually something to be learned , even from the conversation with the jerk that's insulting your mother , kicking your dog , and questioning your sexuality . * Clever/smart content is prized . A dumb/lazy contribution will be called out . A contributor may abruptly be pointed to references on how to do things [http://www.catb.org/esr/faqs/smart-questions.html%|%the smart way] . This is an opportunity to avoid the temptation to take offense , to think about what the smart way might be , and improve . Being smart is just a matter of practice . * It is never necessary to ask for permission to make an edit . * It is not necessary use external side channels to get approval or build consensus in advance for controversial edits . The wiki ''is'' the side channel , and consensus can be hashed out right here on its pages . However , discussions may be moved off to another page . * In the case of an edit conflict , a contributor should attempt to explain their position and rationale – again and again and again , and also to rethink their position – again and again and again . * When there is a succession of alternating edits representing competing viewpoints , to avoid falling into a rut of disagreement each edit should provide some new information or offer some new non-superficial variation of a previous edit . The idea is to keep the content and perspectives evolving . In many cases , a permutation on an idea is a sufficient alternative to direct conversation , but in other cases , it isn't . * Contributors are welcome to make a mess while they play , and even more welcome to put their toys back on the shelves when they are done . * This wiki is a good place to chat with other Tclers . * This wiki may contain content that makes you look stupid to your boss and coworkers . * This wiki is a good place to contribute code written under the influence of hallucinogenic substances . * Personality and flair are welcome , but are no substitute for quality content . * Signal-to-noise ratio is perhaps the top priority for all content. * Any topic even remotely-related to Tcl is fair game . Sometimes just being a Tcler , and having some other interest , is sufficient . That said , the signal-to-noise ratio should remain high . Every contribution should add value . If it doesn't , it might be deleted in short order . * The wiki is a teaching tool . Beginning Tclers are encouraged to ask questions and even to make changes to established content if they think they can improve it . If they are wrong , more experienced Tclers will take the opportunity and time to provide the requisite explanations . * A contributor who is right , and gets angry because another contributor is wrong , might as well go off and maintain their own website , as they are bound to be disappointed here . * This wiki needs a greater diversity of editors . If you are a child , teenager , retiree , or otherwise total newbie to programming , or know someone who is and might want to take up a new hobby , please encourage them to start learning Tcl and contributing to this wiki ! ** Pages Authored ** [A Message User Agent]: Originally based on [A little NNTP reader] , but undergoing continuous rewrite at the moment . [The Anatomy of an Object System]: A walk-through of the design of an object system similar to [ycl shelf] . [Android SDK]: How to make an image of a block device in an android system via `adb` . [Asynchronous Script Evaluation via Coroutines and Channels]: A building block for [distributed computation%|%distributed systems] . [cmdSplit%|%cmdSplit]: Contributed `wordparts` , `exprlex` , and `funclex` . [cmdStream]: One of my early Tcl scripts . [Creating an Invalid Tcl_Obj via SQLite]: Because SQLite doesn't encode a blob into the database encoding when casting to text , it is possible to create a malformed [Tcl_Obj] with just a Tcl script . [critbit]: Improved description of intermediate and leaf nodes . Removed inaccurate information and described the alternatives for storing key-value pairs . [daerth]: Threaded asynchronous pipelined backpressure-mediated pipelined death stations . [deep dict]: A [deep list] in which each structured [value] is itself a deep dictionary . [deep list]: A standard Tcl list in which each single [value] is encoded as a list containing only one item , and each sequence of values is a list containing more than one item . This makes it possible to differentiate e.g. , the single value `one two three` from a list containing the values `one` , `two` , and `three` . [Every Word is a Constructor]: An argument for typed values . [Execute in Parallel and Wait]: Execute multiple processes which run in parallel , and wait for them to complete . [Expect: Mediating an Interaction]: Monitor user input and program output , making sure they don't say "Ni!" . [Expect: Prompt Detection]: An attempt to automatically detect the prompt of a program spawned with [Expect] . [for in]: A [wrapping commands%|%drop-in replacement%|%] for `[for]` that also accepts with [iterator protocol%|%iterators] . [How to Write Quality Documentation]: A companion to [Tips for Writing Quality Software] . [images2pdf]: A small utility to create a [pdf] document from a bunch of images . Uses [pdf4tcl] . [inter-coroutine return]: How cooperating [coroutine%|%coroutines] can operate as a virtual call stack . [knit]: A small but complete(ish ?) [macro] system that leverages `[tailcall]` . [lexec]: [Alexandre Ferrieux%|%Alexandre Ferrieux's] implementation of [TIP 424] , ''Improving `exec`'' , rolled into its own package . [lproc]: Like `[proc]` except that the body is a list of lists and no [pure value%|%string representation] of the body is generated . [lswitch]: Like `[switch]` , but each ''pattern'' is a list of patterns to match against the item in ''string'' at the corresponding position . All switch options are supported . [main script]: How to determine whether a [script] is the main script of an interpreter . [my oh my]: A response to a question by [jbr] in [Ask, and it shall be given # 11] . [nxs]: '''N'''ested e'''X'''tensible heterogeneous data '''S'''tructures . [Playing newLISP]: Procedures that modify themselves while they are being evaluated . [procstep]: A drop-in replacement for `[proc]` that evaluates one command of a procedure body at at time , and a hook to inspect and manipulate the command before it is evaluated , and another to react to return conditions of the evaluation . [proc alias]: The details of creating an alias for a procedure while avoiding the drawbacks of `[interp alias]` . [pure value]: Pure values are values whose string representation has not been generated . [Regular Expressions Match Requirements]: A set of expectations for regular expressions . [Rust]: 2022-05-08 , added initial description of the language . [Scripted List]: Avoid backslash in multi-line lists while still retaining variable and command substitution , add comments into the list a-la [Unix] [shell%|%shells] . [scripted templates]: A [Template and Macro processing]/[macro] system based on [scripted list] . [simulating daily temperatures]: A demo that simulates daily temperatures based on empirical data, and displays them using [plotchart]. [sneaky message passing]: Out-of-band channels for passing data to components . [stowroutine]: Give a routine a [namespace] to play in . [Tcl Minimal Escaping Style]: An escaping style that hews closely to the functional description of braces and quotations in the [dodekalogue%|%Tcl language specification] , not using quotations when braces would suffice , and not using braces unless some backslash substitution would otherwise be necessary . [Tcl Rules Redux]: A restatement of the [Tcl Rules] that articulates the syntax of lists and defines scripts in terms of lists . [thread: -eventmark and send -async]: An interaction in the [thread] package that stymied me over the course of two frenzied weeks until I understood what was going on . [Tkeyes]: An xeyes clone . [vrtcl]: A Tcl-based alternative to [JSON] , [HUDDLE] , [XML] , etc . [ycl]: My personal toolbox . [ycl coro relay]: A small but complete system for communication between cooperating asynchronous coroutines . [ycl shelf]: A simple yet effective [Programming with Prototypes%|%prototype]-based [object orientation%|%object system] . ** Edits to Other Pages ** [@decorators]: Replaced `@memoize` with an implementation that doesn't require an external variable , and is careful not to generate the string representation of its memory . [2048.tcl]: Converted program to event-driven style . Added some features and controls . [3D Maze]: Modified code to not use `[update]` . [3D polyhedra with simple tk canvas]: Modified code to avoid `[update]` . [A balance toy]: Modified code to not use `[update]` . [A Graph plotter]: Minor improvements to functionality and visual elements . [A Hypertext Help System]: Trivial modification to not use `[update]` . [BNF for Tcl]: Contributed to the [BNF%|%EBNF] description of the [Dodekalogue%|%rules]. [bytecode]: Added description of elision of call to empty procedures . [Characters, glyphs, code-points, and byte-sequences]: Includes a link to [https://stackoverflow.com/questions/27331819/whats-the-difference-between-a-character-a-code-point-a-glyph-and-a-grapheme/49793562#49793562%|%What's the difference between a character, a code point, a glyph and a grapheme?] . [Colliding balls]: Fixed a bug where the loop in `checkForCollision` became infinite if the velocity was set too high . [commands pipe]: Contributed a variant of `pipe` . [Convolutions]: Modified code to not use `[update]` and `[vwait]` . [Coroutine cancellability ], {2022 03 24}: Provided an example of a [coroutine] interface that handles both channel events and requests to end the coroutine. [Critcl]: Added an example where one package can import a [C] function exported by another package . [do...until in Tcl]: Contributed a variant that uses `[tailcall]` . [Dodekalogue]: Contributed the Octalogue . [Elevator simulation]: Removed `[update idletasks]` . [Ensemble extend]: Provided the implementation of `extend` that wraps an existing ensemble of routines , and where extension routines are organized into their own namespaces . [exec quotes problem]: Investigated the phenomenon and rewrote the page . [expr]: Contributed the section entitled , "A Logical Conundrum" . [Flag signalling]: Minor modification to not use `[update]` . [Functional imaging]: Removed `[update]` , various changes to the user interface . Added object system to turn it into a widget that can be instantiated multiple times . Consolidated contributed code examples into one script . [Functional Imaging with a High-Capacity GUI]: Change to the design of the system to fix existing issues . [Gadgets]: Added a [namespace] and a test suite . Made generated code more robust by encapsulating interpolated values in list format . [Gear Animation]: Removed `[update]` . [Graphs: BFS an DFS animated demo]: Removed `[update]` . [Graphs: Dijkstra animated demo]: Removed `[update]` . [GRIDPLUS2]: Added section regarding how to modify GRIDPLUS2 so that it properly handles newlines that are not command delimiters in a layout. [How to embed Tcl in C applications]: Added an example of using the stubs mechanism on [posix] systems to initialize Tcl , and another example of accessing the [TclOO] [C] interface when embedding Tcl . [Jittering toplevel]: Removed `[update]` , added `jitter` parameter . [Moon Lander]: Removed `[update]` , minor usability improvements . [More model railroading]: Removed `[update]` . [Move an item on a Canvas Widget in a Straight Line (animated)]: Removed `[update idletasks]` . [owh - a fileless tclsh]: Fixed what looked like a bug: With the default split behaviour there was an error on an input line that wasn't a list . [Particle System]: Removed `[update]` . [Playing with bits]: Wide'ified the original code by [RS] . [Rain Storm - Take 2]: Removed `[update]` . [Regular Expressions]: Lots of touch-up . [returneval]: Elaborated on the tailcall-optimizing `call_eproc` of [Lars H] . [Serial summing]: Updated the system to use `[apply]` and `[tailcall]` . [SQLite]: Added examples illustrating the various [EIAS] violations of SQLite . [stacking]: Replaced Larry Smith's Code with a rewrite that avoids proliferation of global variables by using stacks and indexes in namespace dictionaries instead . [Stubs - Another explanation]: [https://wiki.tcl-lang.org/diff/Stubs%20-%20Another%20explanation?V=5&D=7#diff0%|%Revised] the description of the stubs mechanism . [subst]: Added section on generating [script%|%scripts] and [list%|%lists] . Reworked description and other content . [TIP #431 Discussion]: The issue of `[file mkdir]` behaving like Unix `mkdir -p` , and having no analogue to just `mkdir` . [TkAlign4]: Replaced `[update]` with `[coroutine]` . [Tool Protocol Language]: Provided a more straight-forward example of using [Tcl] script format for passing messages . [trains2.tcl]: Removed `[update]` . [trains3.tcl]: Removed `[update]` . [transchan]: {2022 03 25} Described the pecularities of using a transformer on a standard channel. [tree]: Added a description of a format for a value that represents a tree . [XML]: Described the proper use of attributes in tags as data about the document itself rather than as data about the subject of the document . [yieldTo]: How to implement `[uplevel]` with `yieldTo` . [Vogel spiral]: Started editing code to remove `[update]` from loops , but then it turned into a project to practice the art of programming in Tk . Any tips and/or productive modifications to the code are welcome ! This revision runs noticeably faster than the previous one , probably due to changes that take better advantage of [bytecode%|%byte compilation] . It also illustrates a method for [Disable autorepeat under X11%|%distinguishing true key events from auto-repeated ones] , which is used to make the accelerating [ttk::spinbox%|%spinbox] work with arrow keys . See revision 4 of this page for the previous version . ** Tcl Core Activity ** [https://core.tcl-lang.org/tcl/rptview?rn=16%|%bug reports]: [https://core.tcl-lang.org/tcl/info/7188cd70e0105141%|%Fix memory leak in ZipFSPathInFilesystemProc().] {2023 03 19}: Discovered and fixed . [https://core.tcl-lang.org/tcl/info/3082cb9e802edb9f%|%Make valgrind_foreach target in Makefile.in properly handle interrupted tests] {2023 03 16}: [https://core.tcl-lang.org/tcl/info/ea69b0258a9833cb%|%Crash when using a channel transformation on TCP client socket], {2023 03 16}: Diagnosed and fixed for Tcl 8.6 in [https://core.tcl-lang.org/tcl/info/a8b8ecbc039fb4e0%|%a8b8ecbc039fb4e0] and [https://core.tcl-lang.org/tcl/info/a719a1392ca50359%|%a719a1392ca50359] , for Tcl 8.7 in [https://core.tcl-lang.org/tcl/info/6d017aacac9dd19d%|%6d017aacac9dd19d] and [https://core.tcl-lang.org/tcl/info/294e0130dcff79a3%|%294e0130dcff79a3] , and for Tcl 9.0 in [https://core.tcl-lang.org/tcl/info/62058cafe065cb35%|%62058cafe065cb35] and [https://core.tcl-lang.org/tcl/info/a76dee9eb447f3f9%|%a76dee9eb447f3f9] . [https://core.tcl-lang.org/tcl/info/762f581ae336be9f%|%Fix Valgrind "still reachable" report in TestcmdtokenCmd()] {2023 03 03}: [https://core.tcl-lang.org/tcl/info/ee08ed090b0a5408a0ad2e4fab429adec4aa31bf%|%sporadic segmentation fault in coroutine.test/coroutine-7.4] {2023 01 27}: Discovered, reported, diagnosed, and fixed in [https://core.tcl-lang.org/tcl/info/417d67fc63d237b7%|%417d67fc63d237b7] . [https://core.tcl-lang.org/tcl/info/21ded00dfb659fcf%|%Test TableFromUtfProc() with strict handling of encoding errors] {2023 01 25}: New test . [https://core.tcl-lang.org/tcl/tktview/8f7fdea2dfe5a2955cf729aa7c5a433f290d9112%|%string-2.20.1 fails on big endian] {2023 01 12}: Fixed in [https://core.tcl-lang.org/tcl/info/9858a68816f2053a%|%9858a68816f2053a] . [https://core.tcl-lang.org/tcl/tktview/a12ad5c4bd7efcf22906c25feb9a7bebb0aadc5a%|%buffer allocation on every call to Write in tclIO.c] {2022 04 20}: Discovered, reported, diagnosed, and fixed in [https://core.tcl-lang.org/tcl/info/a62764efd4fcdad3%|%a62764efd4fcdad3] and [https://core.tcl-lang.org/tcl/info/d699b9b1453b6734%|%d699b9b1453b6734] . [https://core.tcl-lang.org/tcl/tktview/ac601b59bab79fbe0559f19f65620c28a3287517%|%using the Thread package in a debugging build of Tcl results in a segmentation fault at exit] {2022 03 21}: Discovered , reported , diagnosed , and [https://core.tcl-lang.org/tcl/info/f0a6d62a1ade872d%|%fixed] . [https://core.tcl-lang.org/tcl/info/a5a99f0aef0a6923c4a3ef4c744527a0ed328901%|%lsearch returns different results depending on order of -bisect and -exact arguments] {2021 12 30}: Discovered and reported [https://core.tcl-lang.org/tcl/info/a8579d906a28127d541ba23f7c1223259f97b123%|%'argument with no name' calling proc with args built in different frame] , {2021 10 07}: Fixed in [https://core.tcl-lang.org/tcl/info/75a9777184741e05%|%75a9777184741e05] . [https://core.tcl-lang.org/tcl/tktview/ccc448a6bfd59cbdb2bd5cfd3392e386994883aa%|%namespace ensemble subcommand name prefix matching and a subsequent error results in a segmentation fault] {2021 09 04}: Discovered , reported , diagnosed , and fixed in [https://core.tcl-lang.org/tcl/info/a2e801a3d6c1675b%|%a2e801a3d6c1675b] and [https://core.tcl-lang.org/tcl/info/d49a1b03291b4cde%|%d49a1b03291b4cde] . [https://core.tcl-lang.org/tcl/tktview/5106fddd4400e5b9b063258b44f9685fb4750830%|%failure to yieldto is not the same thing as not calling yieldto in the first place] {2021 06 20}: Discovered , reported , diagnosed as duplicate , and [https://core.tcl-lang.org/tcl/info/d7428a1ea0f47cba%|%added test case] . [https://core.tcl-lang.org/tcl/tktview/f9800d52bd61f240938dbd3c3c6364c8a6184194%|%vwait is not NRE-enabled, and yieldto cannot find the right splicing spot] {2021 06 20}: Discovered , analyzed , reported and fixed in [https://core.tcl-lang.org/tcl/info/eb50e83ee1d8f207%|%eb50e83ee1d8f207] . [https://core.tcl-lang.org/tcl/tktview/048dd20b4171c8da89d94a126e3f98c83178a33d%|%cesu-8 encoding fails on \u80] {2021 06 19}: Discovered and reported . [https://core.tcl-lang.org/tcl/tktview/dcb888ed85adeb86%|%epoll, special files, directories, links, epoll_ctl operation not permitted, and abort] {2021 06 17}: Discovered , reported , diagnosed , and fixed in [https://core.tcl-lang.org/tcl/info/7587b7aeb9ce863c%|%7587b7aeb9ce863c] , with tests in [https://core.tcl-lang.org/tcl/info/dcb888ed85adeb86%|%dcb888ed85adeb86] . [https://core.tcl-lang.org/tcl/tktview/e39cb3f462631a9973e48d27cf5098ca6b537aaf%|%namespace is removed from other namespace paths before deletion is complete] {2021 05 19}: Discovered , reported , diagnosed , and fixed in [https://core.tcl-lang.org/tcl/info/bdd005f3301eec51%|%bdd005f3301eec51]. [https://core.tcl-lang.org/tcl/tktview/28027d8bb7745fb053954276bb62aa4d6e340b16%|%Per-interp Loaded library structures not cleaned up on interp exit.] {2021 05 15}: Discovered , reported , diagnosed , and fixed in [https://core.tcl-lang.org/tcl/info/a4de334c5f297a92%|%a4de334c5f297a92] , [https://core.tcl-lang.org/tcl/info/723d1eb93779e81b%|%723d1eb93779e81b] , and [https://core.tcl-lang.org/tcl/info/ccfd61a7cf6bce85%|%ccfd61a7cf6bce85] , and more on the [https://core.tcl-lang.org/tcl/timeline?r=pyk-tclUnload%|%pyk-tclUnload] branch . [https://core.tcl-lang.org/tcl/info/526b47d269af8d75%|%Fix quoting issues in gdb-test and lldb targets.] {2021 05 13}: Makefile madness . `valgrind` and `lldb` targets now interpret `TESTFLAGS` (and other) arguments the same way the `test` target does . [https://core.tcl-lang.org/tcl/tktview/463b7a93be0a2ddd3484d776b83e2b8ab6f63f0c%|%Tcl_Unload, make gdb-test, segmentation fault] {2021 05 14}: Reported, diagnosed, and [https://core.tcl-lang.org/tcl/info/343281a570d47661%|%fixed] . [https://core.tcl-lang.org/tcl/tktview/fb2a411b91973d%|%tclZipfs.c exit handlers don't deallocate allocated storage.] {2021 05 15}: Discovered, reported, and fixed in [https://core.tcl-lang.org/tcl/info/47601ca8e37b50f4%|%47601ca8e37b50f4] and [https://core.tcl-lang.org/tcl/info/20117765bd03fc9f%|%20117765bd03fc9f] . [https://core.tcl-lang.org/tcl/info/c250c25de553fbe2%|%Segmentation fault when closing a channel in an event handler for that channel] {2021 04 26}: And also some [https://core.tcl-lang.org/tcl/info/f44cac056f981492%|%tests] for the issue . [https://core.tcl-lang.org/tcl/info/e9c99bce1dd199b3%|%New test constraints] {2021 04 27}: "debug" , "purify" , and "debugpurify" . [https://core.tcl-lang.org/tcl/tktview/f6fbc71cd160d7796065a0933182e3d34cc11e3f%|%with "make valgrind", safe-zipfs-5.5 fails with the error, 'can't set "path": variable is array'] {2021 04 25}: Reported , diagnosed , and fixed in [https://core.tcl-lang.org/tcl/info/ac18feaba778d8c7%|%ac18feaba778d8c7] . [https://core.tcl-lang.org/tcl/tktview/1f4af0a127369d4a1b585063cc5a2a1d0a752d4b%|%zipfs-5.1 Valgrind, TclZipfs_MountBuffer, "1 blocks are definitely lost"] {2021 04-20}: Reported , diagnosed , and fixed in [https://core.tcl-lang.org/tcl/info/dd4f24fce90dc392%|%dd4f24fce90dc392] . [https://core.tcl-lang.org/tcl/tktview/ec06d0db3225afca%|%Tcl_AppendObjToObj and Tcl_GetUnicode lead to Valgrind "Invalid read of size".] {2021 04 21}: Reported , diagnosed , and fixed in [https://core.tcl-lang.org/tcl/info/c7100a073ba1e0b8%|%c7100a073ba1e0b8] . More fixes in [https://core.tcl-lang.org/tcl/info/ec5b3d21f9b29ee9%|%ec5b3d21f9b29ee9] for similar issues reported by Valgrind . [https://core.tcl-lang.org/tcl/info/330ec158a8e45350%|%New test for segmentation fault] {2021 04 03}: Occurs when the handle on the routine that represents the object is accessed during deletion of the namespace for an object , but that routine has already been deleted and the handle nullified . Fixed in [https://core.tcl-lang.org/tcl/info/3ddbaef3566385a2%|%3ddbaef3566385a2] . [https://core.tcl-lang.org/tcl/tktview?name=0d61d3a2bb%|%Tcl interprets two adjacent surrogate code points as a character encoded using UTF-16] {2021 03 06} : Reported and discussed . [https://core.tcl-lang.org/tcl/tktview/c1a376375e0e648830cf52ca984a9ace563c0706%|%imported namespace ensemble command name distorted during deletion trace on the import] {2020 09 02}: Discovered , reported , diagnosed , and [https://core.tcl-lang.org/tcl/info/ebe34426255bef25%|%fixed] . [https://core.tcl-lang.org/tcl/tktview/1eb488b699d74e0f9d22ea5fc78aa41aa5a77a14%|%double free when deleting namespace containing the origin routine for some imported routine] {2020 08 20}: Discovered , reported , diagnosed , and [https://core.tcl-lang.org/tcl/info/08e3b17c955f062d%|%fixed] . [https://core.tcl-lang.org/tcl/tktview/688fcc7082fa99a4bd934098c58666841e9e0b0a%|%trace on imported alias deletes alias and then calls import and triggers memory error] {2020 08 16}: Discovered , reported , diagnosed and [https://core.tcl-lang.org/tcl/info/037c0ff27fd5d0a2%|%fixed] . [https://core.tcl-lang.org/tcl/tktview/29e8848eb9766b81413989ad8125b0c22d1d2c7e%|%calling an imported alias in a deletion trace on the alias causes Tcl to cycle on routine resolution] {2020 08 10}: Discovered , reported , diagnosed , and [https://core.tcl-lang.org/tcl/info/68a1f5598fe5b281%|%fixed] . [https://core.tcl-lang.org/tcl/tktview/3422267ed6b79922ca6a69883d4e39901516443e%|%segmentation fault from deleting the the target of an imported alias during a trace on the target of the alias] {2020 08 16}: Discovered , reported , diagnosed , and fixed in [https://core.tcl-lang.org/tcl/info/37243ff47659d65c%|%37243ff47659d65c], [https://core.tcl-lang.org/tcl/info/de751a349009f88a%|%de751a349009f88a] , [https://core.tcl-lang.org/tcl/info/b9d1a1ce1aef55c3%|%b9d1a1ce1aef55c3] , with a test case at [https://core.tcl-lang.org/tcl/info/2da1596304896026%|%2da1596304896026] . [https://core.tcl-lang.org/tcl/tktview/9ee9f4d7be4615e04f62fe22885dadce13ca4d01%|%zlib push/pop corrupts underlying channel] {2020 06 16}: Discovered and reported . [https://core.tcl-lang.org/tcl/tktview/b9ecf3ce9801c480620f83b34110f808bd11affb%|%`[[uplevel $list]]` , `[[uplevel 1 $list]]` and generation of string representations] {2020 05 05}: Reported , diagnosed , and [https://core.tcl-lang.org/tcl/info/45569c7084346632%|%fixed] . [https://core.tcl-lang.org/tcl/info/9128866ec8448752%|%tis-620 encoding fails to load] {2020 01 04}: Discovered , reported , diagnosed , and [https://core.tcl-lang.org/tcl/info/b9c7c87500e9c0fd%|%fixed] . [https://core.tcl-lang.org/tcl/tktview/934e6eb9cf15782433ffbc2f56cecdac30c596f5%|%ensemble unknown handler confused by tailcall] {2020 01 03}: Discovered and reported . [https://core.tcl-lang.org/tcl/tktview/f7afd3dbef3c3a8e73687a76f8009ee19729544c%|%tailcall does not trigger an namespace unknown handler] {2019 12 24}: Discovered and reported . [https://core.tcl-lang.org/tcl/vdiff?from=19b294baa382a2a3&to=b8be012969c62536%|%tcltest::SetupTest] and [https://core.tcl-lang.org/tcl/info/0f3d6f90f0186fcb%|%tcltest::EvalTest] {2019 12 01}: Laying the groundwork to customize the behaviour of tcltest such that each test is evaluated in a separate interpreter for real test independence . [https://core.tcl-lang.org/tcl/tktview/3d40c2da8175daba83ef373c8b8d9e147744fe4c%|%regexp (?:a*b)+c indices wrong] {2019 11 24}: Discovered and reported . See also [Regular Expressions Match Requirements] . Marked as invalid, but I want to take a close look at it sometime. [https://core.tcl-lang.org/tcl/tktview/135804138e33ff05b89f06101008113c86156322%|%TclOO segmentation fault: direct call to a method called by the object destructor , and that deletes the object via rename before calling next] {2019 11 13}: Reduced a reported issue in a complex systems to a reproducible test suite , diagnosed , and reported . [https://core.tcl-lang.org/tcl/tktview/bcd1004104651998d1ae99aa6869e249c0ed0019%|%A change to the system encoding , a stale cached file FsPath object , and an incorrect result] {2019 10 22}: Discovered , diagnosed , reported , and [https://core.tcl-lang.org/tcl/info/440efbd556ce7041%|%fixed] . [https://core.tcl-lang.org/tcl/tktview?name=ab4307e01b%|%changing [encoding system] can corrupt [encoding dirs]] {2019 10 21}: Discovered and reported . [https://core.tcl-lang.org/tcl/tktview/de232b49f26da1c18e07513d4c7caa203cd27910%|%write-only nonblocking refchan and Tcl internal buffers] {2019 05 06}: Diagnosed , reported , and [https://core.tcl-lang.org/tcl/info/d0dd6d19a41ae7af%|%fixed] . See also [https://core.tcl-lang.org/tcl/tktview?name=ef28eb1f15%|%TCL_FILE_EVENTS cannot drive async I/O alone] . [https://core.tcl-lang.org/tcl/info/45b9faf103f2%|%try interaction with local variable names produces segmentation fault] {2019 04 08}: Discovered , reported , diagnosed , and [https://core.tcl-lang.org/tcl/info/45b9faf103f2%|%fixed] . [https://core.tcl-lang.org/tcl/info/1e3b9149a7679213%|%Fixed memory leak in TclOO.c:ObjectNamespaceDeleted, object mixins and object/class mutation.] {2018 11 01}: [https://core.tcl-lang.org/tcl/tktview?name=723a2f4ac3%|%return -code break/tailcall break from coroutine goes wrong at the top-level] {2018 07 31}: Discovered and reported . [https://core.tcl-lang.org/tcl/info/67a5eabbd3%|%refchan , coroutine , and postevent from the "watch" proc] {2016 08 15}: Discovered , reported , diagnosed , and [https://core.tcl-lang.org/tcl/info/e066e24f36f67a8d%|%fixed] . Further analyzed and defended in [https://core.tcl-lang.org/tcl/tktview/18f4a94d03b075c6295903f1f7b80f7e15b156d6%|%a blocking memory channel no longer works] , {2021 06 09} . [http://core.tcl-lang.org/tcl/timeline?r=memleak%|%Fix more memory leaks in TclOO cleanup routines] {2018 03 14}: Add tests that isolate leaks to certain TclOO facilities . [https://core.tcl-lang.org/tcl/tktview/3592747%|%(tailcall|yieldto) failed to find the proper namespace Abort] {2018 06 28}: Added script to reproduce . Fixed in [https://core.tcl-lang.org/tcl/info/9198c16407f3%|%9198c16407f3] . [TIP] [https://core.tcl-lang.org/tips/doc/trunk/tip/498.md%|%498 - Simplify Tcl_DeleteNamespace]: Simplify the implementation of Tcl_DeleteNamespace in order to make behaviour more consistent , facilitate the resolution of outstanding issues , and pave the way for further developments . [https://core.tcl-lang.org/tcl/info/01a902f856f1aa35%|%NRE-enable `package require`]: Allows for a coroutine to yield from a script evaluated during `[package require]` . [http://core.tcl-lang.org/tcl/timeline?r=pyk-pkgrequirenre%|%A previous , less polished implementation] no longer applied cleanly . [https://core.tcl-lang.org/tcl/info/ba1419303b4c%|%Delete a namespace for an ensemble having a deletion trace deletes its namespace: segmentation fault.]: [https://core.tcl-lang.org/tcl/info/c0fcc0ae0338fbb9%|%Fixed] . [https://core.tcl-lang.org/tcl/info/2201fdb82c1a46e0%|%Further refactoring of TclOO object cleanup routines]: Also resolved [https://core.tcl-lang.org/tcl/tktview?name=2713bfcb01%|%TclOO, segmentation fault: deleting a class mixed into an object that calls a method on the class in a deletion trace] . [https://core.tcl-lang.org/tcl/tktview/6bca38d59b1f9c11272beb130b37e0fadcfbe1ab%|%TclOO segmentation fault cleaning up objects that that have mixed themselves into themselves]: [https://core.tcl-lang.org/tcl/info/313a7c1b8a91b234%|%Fixed] . [https://core.tcl-lang.org/tcl/info/6f60945f3dc9ce9c%|%Streamline TclOO object cleanup routines]: [https://core.tcl-lang.org/tcl/tktview/4f6a1ebd64cffa3ef795d83cb15d92c40cfb12bd%|%ensemble: segmentation fault when -subcommands and -map values are the same object]: [https://core.tcl-lang.org/tcl/info/046a5af026d82a5c%|%Fixed] . [https://core.tcl-lang.org/tcl/info/b433ae397c%|%namespace ensemble command named ":" is mistakenly given the empty string as its name.]: [https://core.tcl-lang.org/tcl/info/b433ae397cddec658ac8789ea02636671799388da9097c404b0fbdbf551063ac%|%Fixed] . See also [https://core.tcl-lang.org/tcl/info/93c437ef370480b3c80fb63726a3e460467df37%|%thefix] for a [https://core.tcl-lang.org/tcl/info/6cf568a21bd8fc9b%|%followup issue] . [https://core.tcl-lang.org/tcl/info/fbd05fa61d771817%|%Modify TclCreateProc to handle arbitrary argument names, not just ASCII]: [https://core.tcl-lang.org/tcl/tktview/3c32a3f8bd%|%segmentation fault in TclOO.c/ReleaseClassContents() for a class mixed into one of its instances]: [https://core.tcl-lang.org/tcl/info/5f178e7f03620adc%|%Fixed] . [https://core.tcl-lang.org/tcl/tktview/9fd5c629c1%|%TclOO - aborts when a trace on command deletion deletes the object's namespace]: [https://core.tcl-lang.org/tcl/info/bee7f97ad6521604%|%Fixed] . [https://core.tcl-lang.org/tcl/tktview/fc1409fc91%|%TclOO method with non-literal value for body argument causes segmentation fault]: [https://core.tcl-lang.org/tcl/info/d6d4b18fc17d61dc%|%Fixed] . [http://core.tcl-lang.org/tcl/timeline?r=pyk-emptystring&unhide%|%Avoid generating string representation when comparing against the empty string].: [http://core.tcl-lang.org/tcl/timeline?r=pyk-listdictstringrep%|%caching objects]: Use duplicate `[Tcl_Obj]` structures to hang onto previous intreps . Eliminates the need to generate a string representation of a list that contains redundant keys when used as a dictionary . `[string length]` No longer causes intreps of items in a list or dictionary to be discarded . With a little more work , `[string range]` could be modified to take advantage of the cached objects and not generate a string for the entire list or dictionary just to derive some substring . The next step is to take advantage of this patch to never generate the string representation of a full list or dictionary . This patch introduces `TclObjLookupTyped()` , which returns a `[Tcl_Obj]` of the desired type , or `NULL` if there isn't one handy . Such an interface could prove generally useful in further development of Tcl . [https://core.tcl-lang.org/tcl/info/a4494e28ed%|%alias trace did not find command in real command list of import references]: Discovered and reported . [https://core.tcl-lang.org/tcl/tktview?name=3484402%|%off-by-one address error in AppendUnicodeToUnicodeRep] , 2012-02-04: Reported and diagnosed . ** Tcl Core - Documentation ** [https://core.tcl-lang.org/tcl/info/c59275918766d95f%|%Make the descriptions in doc/Tcl.n more concise and intuitive] {2023 02 28}: Reduced the size of doc/Tcl.n by 41%. Back down to 10 rules, and "list" is specified. [https://core.tcl-lang.org/tcl/info/0ef72df401df2216%|%SaveResult3]: Reduced word count by 40% . [https://core.tcl-lang.org/tcl/info/eb627bda27968937%|%chan.n] , 2022-01-22: Reduced word count by 26% . ** Other Tcl Project Activity ** ([sqlite]) [https://sqlite.org/forum/forumpost/efcccc2dc1%|%Tcl bytearray woes]: Diagnosed and reported. [https://groups.google.com/g/comp.lang.tcl/c/WyakzpV9D1U/m/yOCwDXZLFVAJ%|%[[set v ""]] = bytearray object?], [comp.lang.tcl] {2005 06 21} is an earlier report of the same issue. ([tcllib]) [https://core.tcl-lang.org/tcllib/info/a0a2c6e9cac723e2%|%add end-of-line signaling to tcl::chan::halfpipe] {2022 01 25}: ([tcllib]) [https://core.tcl-lang.org/tcllib/info/8a5b6fdec2b4f560%|%make coroutine::util gets/read more efficient, and also restore any existing handler when finished] {2022 01 18}: ([thread]) [https://core.tcl-lang.org/thread/info/2b5e85ab4287d2531d3f4a6366dd82e6aca6a035%|%thread::errorproc is called twice for one error, once for "worker" and once for "main" thread] {2021 11 10}: Discovered and reported. ([thread]) [https://core.tcl-lang.org/thread/info/5f2922dd6d36f043966bbfff9d5293f8b7c5c121%|%interp bgerror is ignored in thread, error sent to other interp instead] {2021 11 10}: Discovered and reported. ([sqlite]) [https://sqlite.org/forum/forumpost/1a0cce80481c1061adc1a5ea93b741cecdf22a4c684fc1e3b2053cb41529c61e%|%segmentation fault when closing a database from within a transaction], sqlite {2021 09 14}: Discovered and reported . Subsequently [https://www.sqlite.org/src/info/e54a33ce56432b23%|%fixed] by Dan Kennedy. ([tohil]) [https://github.com/flightaware/tohil/issues/53%|%Tohil issue 53, error {No module named 'tohil' (unable to import tohil module to python interpreter)] {2021 08 12}: Reported, diagnosed, and fixed in [https://github.com/pooryorick/tohil/commit/b5cebdf4f252a6ed8a44911c847695479f17cfb0%|%b5cebdf4f252a6ed]. ([tohil]) [https://github.com/flightaware/tohil/issues/52%|%Tohil issue 52, `package require` fails after `package forget`] {2021 08 11}: Reported and diagnosed. ([tohil]) [https://sqlite.org/forum/forumpost/0ff4ede3e1%|%(sqlite) conversion of literal values, or lack thereof] {2021 06 04}: Inconsistent conversion of string values to numeric. ([tcllib]) testutilities, [https://core.tcl-lang.org/tcllib/info/e310e3a368abddbd%|%remove sensitivity to directory a test is invoked from] {2021 04 14}: Makes it easier to run a test without using `sak`. [sqlite] [https://www.sqlite.org/forum/forumpost/d17ad0001c%|%null character sorts greater than 0x7f and less than 0x80] {2020 08 01}: Discovered and reported . [sqlite] Tcl coroutine , [https://sqlite.org/forum/forumpost/4638e41470%|%db eval ... script` , yield, segmentation fault] {2020 04 09}: Discovered , reported, and diagnosed. [pdf4tcl]: [https://sourceforge.net/p/pdf4tcl/code/ci/2835dd03c56062bf1310de3f521afca21e187c74/tree/pdf4tcl.tcl?diff=e8434b27271aa269f46ca1bb66368413da434781%|%Added support] for [TIFF] images with group-4 compression . [tcllib]: [https://core.tcl-lang.org/tcllib/info/ecb61a8a4fe7623e%|%Isolate the evaluation of each .test file]: A response to a test failure that arose from the interaction of two .test files . ([tcllib]) [https://core.tcl-lang.org/tcllib/info/a9488befa9bdb1ca%|%mime package: rewrite]: Uses temporary files and channels in order to keep the memory footprint low in all cases . [https://core.tcl-lang.org/tcllib/info/97e9f3adf59badd1%|%Use a command instead of a token] as a handle for a message . For header values , [https://core.tcl-lang.org/tcllib/info/556271270a289ae1%|%add support for parameters that are not key/value pairs] . For cookies , [https://core.tcl-lang.org/tcllib/info/ff79b7401f694c8a%|%add the `HttpOnly` parameter] and make it the default . ([tcllib)] [https://core.tcl-lang.org/tcllib/info/ebcce7f24e38ff15%|%mime package: new API]: Offers the ability to read in messages from a channel , more consistent and straightforward manipulation of message headers , and more flexibility for use as a general Internet Message library . See also commit [https://core.tcl-lang.org/tcllib/info/37008172d9107099%|%37008172d910] . ([tcllib]) [https://core.tcl-lang.org/tcllib/info/ccd9433cb2abd51c%|%Namespace resolution for relative namespaces] in [namespacex]: Diagnosed and fixed . `[Tcllib MIME%|%MIME]` issue , [https://core.tcl-lang.org/tcllib/tktview/792796ffffffffffffffffffffffffffffffffff%|%Let ::mime::parsepart accept a header only with multipart] : Fixed . `[Tcllib MIME%|%MIME]` , [https://core.tcl-lang.org/tcllib/info/c55b8ef304a27925%|%added a default value] of `multpart/mized` when `-parts` is provided: This should make `mime::initialize` a little more user-friendly . `[Tcllib MIME%|%MIME]` issue , [https://core.tcl-lang.org/tcllib/tktview/1613224fffffffffffffffffffffffffffffffff%|%too much braced message header values (::mime::getheader)]: Fixed . `[Tcllib MIME%|%MIME]` issue , [https://core.tcl-lang.org/tcllib/tktview/763669ffffffffffffffffffffffffffffffffff%|%Problems with qp_encode and encoded_word, no_softbreak]: Fixed . ([tcllib]) `[fileutil%|%fileutil::magic::filetype]` issue , [https://core.tcl-lang.org/tcllib/tktview/1329207%|%mimetype, filetype result empty for text files]: Fixed . ([tcllib]) `[fileutil%|%fileutil::magic::filetype]` issue , [http://core.tcl-lang.org/tcllib/tktview/4adb7c36a35d0c475f8e9bba24ec04984bd8ce2f%|%TCL fileutil::magic::mimetype not recognising Microsoft documents or mp3]: Fixed . ([tcllib]) [https://core.tcl-lang.org/tcllib/info/c48961ab8e97217b%|%Another round of work on fileutil::magic]: Fixed issue [https://core.tcl-lang.org/tcllib/tktview?name=4ff12e3abd%|%::fileutil::magic fails to identify mimetype] , and also other issues . ([tcllib]) [ncgi%|%Tcllib ncgi] issue , [https://core.tcl-lang.org/tcllib/tktview?name=063e7a95be%|%Correct Handling of quotes in quoted strings in parseMimeValue]: [https://core.tcl-lang.org/tcllib/info/e4a17a66b17a2bbe%|%Fixed] . [Tcllib MIME%|%Tcllib mime] issue , [https://core.tcl-lang.org/tcllib/tktview/a16b1095974e071d294ccbc0cf4671148bddab76%|%Error in mime.tcl]: [https://core.tcl-lang.org/tcllib/info/074ec6a961081540%|%Fixed] and added a test case . ([TclX]) [http://chiselapp.com/user/pooryorick/repository/tclx/info/9b4ec9792997a42e%|%Update the build files for TclX]: Also replaced deprecated autoconf functions . [tclconfig]: [https://core.tcl-lang.org/tclconfig/tktview/0d56ddedbebef31d%|%CFLAGS broken at configure time]: Untangled the offending strings from CFLAGS and made the [https://core.tcl-lang.org/sampleextension/info/4767411521e3baf0%|%corresponding changes] in [sampleextension] . ([thread]) [https://core.tcl-lang.org/thread/info/76f47e0376fb%|%thread::send -async script varname aborts with "alloc: invalid block"]: Reported and fixed , but then [sebres] produced a [https://core.tcl-lang.org/thread/info/98170da1657fb2dc%|%better fix] . ([tdom]) [http://tdom.org/index.html/tktview?name=97c0994ae4%|%tdom: selectNodes -cache 1 and a syntactically incorrect xPath statement] , 2017-06-16: ([tdom]) [http://tdom.org/index.html/tktview?name=73b0bbd85e%|%removeAttributeNS: segmentation fault when there are other attributes with no namespace] , 2017-06-17: ([tcllib]) [fumagic] , 2016: [https://core.tcl-lang.org/tcllib/info/265bbde03ac1e579%|%Significant modifications] to bring fumagic , aka `[fileutil%|%fileutil::magic::filetype]` much closer to feature parity with [http://darwinsys.com/file/%|%file(1)] , and to be capable of ingesting the latest magic spec files . [sqlite] issue : [https://www.sqlite.org/src/tktview?name=d06a25c844%|%Incorrect result from a UNION with an ORDER BY] .: Discovered and reported . [thread] issue : [https://core.tcl-lang.org/thread/tktview?name=a57b6c3fd4%|%-eventmark + thread::send -async == deadlock] , 2015-04-12: Discovered , reported and fixed . ** Technical Contributions to Projects not related to Tcl ** [https://wiki.archlinux.org/title/HP_ENVY_m4-1015dx%|%Instructions for updating the BIOS of an HP Envy m4 without using Windows]: ** Reclaimed Programs ** One of my ongoing projects is to give abandoned Tcl programs a new home . Here is a list of the rescues to date . [KalininLaTeXeditor]: ** Open Questions ** *** Should there be a `fork` command for [coroutine%|%coroutines] ? *** Seems like something that might be fun/useful [AMG]: I've asked about this before on the [coroutine] page . Search for "Cloning" . Sorry , not going to happen . Quote from [MS]: "The real obstacle is that each coroutine has its own Tcl stack , which stores (among other things) pointers to itself . Making a copy of that stack implies fixing those autorefs , which in turn implies storing the nature of each entry in the stack to know if it has to be fixed or not (and how) , which in turn implies a redesign of the tcl stack ." *** Should [Dodekalogue%|%variable substitution] be more script-like ? *** Assuming the following alternate definition of variable substitution , : In a word , `$` and the variable name immediately following it are replaced by the value of that variable . The variable name can be a sequence of characters in the range `0-9a-zA-Z` , or , if the variable name begins with `"` , `[[` , `{` , `$` , or `\` , the variable name is determined according to the corresponding rule for '''double quotes''' , '''command substitution''' , '''braces''' , '''variable substitution''' , or '''backslash substitution''' , respectively . Non-whitespace characters may occur immediately after the variable name , i.e. , immediately after the closing `"` , `]]` , or `}` . If the variable is immediately be followed by a string index of the form `(`''index''`)` , ''index'' , which may not contain a literal `)` , is the name of an element with that array . Tcl would behave like this: ======none # warning: hypothetical behaviour % set {{}} hello hello % puts ${{}} hello % puts $[join { \{ \} } {}] hello % set \{ goodbye % puts $\{} goodbye} % set greeting greetings! greetings! % puts $"greeting".yada greetings!.yada % set name {{}} {} % puts $$name hello % puts $"$name" hello % set na \{ { % set me \} } % puts $"$na$me" hello ====== This makes variable substitution more consistent with the other syntax rules of Tcl , and more flexible as well . [AMG]: This functionality is provided by single-argument [[[set]]] . Tcl's `$` notation is a shorthand for single-argument [[set]] that only works for variable names that are literal , though substitutions are allowed inside the array index . I don't understand what you are asking for with your "greetings" example . Tcl already behaves like you show because the period following `$greeting` isn't treated as part of the variable name . In [Brush] I propose a new `$"..."` notation that works like `[[set ...]]` , as shown in your `puts $"$name"` and `puts $"$na$me"` examples . If you want to get silly , this notation can be nested because opening `$"` is distinct from closing `"` . `$$name` is explicitly disallowed because of ambiguity when combined with indexing . Does faux-Brush `$$name{0}` mean the same as Tcl `[[set [[lindex $name 0]]]]` or Tcl `[[lindex [[set $name]] 0]]` ? Instead write `$"$name{0}"` or `$"$name"{0}` to make the intent clear . Brush's proposed `$[[...]]` notation does ''not'' work as shown in your `puts $[[join ...]]` example . To get that behavior , instead write `$"[[join ...]]"` . Brush's `$[[...]]` is a mechanism for applying variable indexing operations to the result of a [[script substitution]] without having to first save the substitution result into a variable . For instance , Brush `$[[command]](key1 key2){1 2}` means precisely the same as Tcl `[[[lindex] [[[dict get] key1 key2 [[command]]]] 1 2]]` . The [C] analogue would be roughly `command()->key1->key2[[1]][[2]]` . [PYK] 2016-04-07: I've added quotes to the "greetings" example , which is there just to confirm that the behaviour in that case doesn't change , in spite of the fact that normally , extra characters aren't allowed after the closing brace or quote . The apparent ambiguity of `$$name(index)` doesn't seem too problematic to me ; interpreting it as the equivalnet of of $"$name(index)" is visually straightforward enough . In that last Brush example I think you meant `[[[lindex] [[[dict get] [[command]] key1 key2]] 1 2]]` . *** Should `[info nameofexecutable]` be fully normalized if it's a symlink ? *** `[info nameofexecutable]` is currently used in the code that sets `[auto_path%|%$auto_path]` in init.tcl , so with the current behaviour , `$auto_path` is set differently for every symlink to a tclsh executable . [EMJ]: Assuming that you mean `init.tcl` . If you have installed `tclsh` in some strange place then that place should be on your path anyway (as , of course , is the official location) . I really don't see why you would ever need a symlink to `tclsh` or `wish` at all . *** Would it scale better to have commands like [[append list ...] rather than [lappend] ? *** [AMG]: I'd much prefer [[list append]] , but the [[`[list]`] command is thoroughly taken . Tcl subcommand structures are typically named by putting the noun (class) first , at least when it's not the case that the object instance handle name is the command name . [PYK] 2013-09-22: Been thinking about it often , and I still have this suspicion that the world might be a better place if we all went with [[verb object ...] rather than [[object verb ...] . It still seems reasonable to me that Tcl could dispatch based what ''type role'' the object most-recently played . [AMG]: I'd be careful about the word "object" in this situation . To me , the word "object" , especially when next door to the word "verb" , is a specific thing being acted on , in other words an instance . In [C++] notation , "`myList.append(value);`" , would have `myList` as the object , or more properly the instance . When you say "object" you really seem to mean "type" . So , how would command dispatch work if the hierarchy went the other way around ? I see types as collections of operations , along with established schemas for values of that type . So types are above operations in the hierarchy . In the Tcl command [ensemble] dispatch concept , that means the type name must go first . Put it second , and things get funny , especially when the ensemble is more than two levels deep . You could implement this if you like , either by making [proc]s for all operations , which take type names as their first arguments , or by making an [unknown] handler that does custom dispatch . As for type inference , this is scary in situations where the type cannot be determined by static , lexical analysis , for instance when operating on an argument to a proc . The behavior of the proc would depend on what the caller had most recently done with the arguments . For instance , let's say the length of a list is the number of space-separated words in its string representation , but the length of a dictionary is the number of keys . How does a proc tell how many words there are in a value that was just passed to it ? It would have to do some dummy operation to force the value to be a list . Now this potentially screws up all the code (including extensions , the proc's caller , any holders of shared values) that assumes the value is a dictionary . Far safer to explicitly say "this is a dict" or "this is a list" every time an operation is performed . In other words , what Tcl already does ! *** should the `[string]` command be retired and its subcommands become "top-level" Tcl commands ? *** [DKF]: [Ensemble]s purely organizational . From 8.6 onwards — or is it 8.6.1 ? I forget when the commit went into HEAD — the built-in ones compile themselves out entirely in almost all cases (the exceptions are some of the complex cases , notably including [namespace eval] and [info frame]); the implementation is used just as if it was an independent command . This isn't done for user-created ensembles , because we suspect the performance cost to [Snit] is suspected to be too high there . (I ought to check that assumption . If it's wrong , it's trivial to turn on compilation for ''all'' ensembles . Contrast with [TclOO] where compilation of the dispatch doesn't make sense at all , and which uses other mechanisms to accelerate .) [AMG]: I wish we could do this with [[[list]]]... :^( *** Should [[`[dict incr]`] return a single value rather than a key-value pair ? *** It would be more consistent with `[incr]` if it did , and most of the time , the single value is what I need . [AMG]: The goal was consistency with most of the other [[[dict]]] commands that take a variable name as their first argument . These commands all return the entire modified dictionary , not just the portion that changed . * [[[dict append]]] * [[[dict incr]]] (of course) * [[[dict lappend]]] * [[[dict set]]] * [[[dict unset]]] If we were to generalize the concept of nested dicts such that a zero-length key path refers to the entire dict , and we were to make all dict commands support key paths , then [[dict incr]] with zero keys would behave the same as [[incr]] . (By the way , [[[dict get]]] and [[dict with]] support zero-length key paths , even though [[dict set]] and [[dict unset]] do not . However , they still expect their argument to be a valid dict , or at least an even-length list , so they do not exhibit the full generalization I just suggested .) There are two other [[dict]] commands that take a variable name as their first argument , but they also take a script as their last argument . Even though they modify the dictionary , these two commands return the return value of the script . This is consistent with non-looping commands like `[eval]` , `[if]` , `[try]` , and `[[[uplevel]]]` that take script arguments . * [[[dict update]]] * [[[dict with]]] ** To Do ** *** Fix sqlite coroutine segmentation fault *** See [https://sqlite.org/forum/forumpost/4638e41470%|%this post]. *** tclTrace.c *** NRE-enable trace routines , starting with variable traces . *** vwait *** NRE_enable `[vwait]` . *** Tcl_FSEvalFileEx and TclNREvalFile *** Remove duplicate code . Also remove duplicate code in `DivertUnloadFile` and `TclFSUnloadTempFile` . *** Tk build *** [https://core.tcl.tk/tk/tktview/94eeb111fb96676cce6d68fa3f0bf48bd68aa59b%|%macos, linux: configuration: unable to build using trunk]: Address the issues leading to reversion of this work , and merge back into trunk . ** `[encoding]` ** Update documentation for `[encoding convertto]` and `[encoding convertfrom]` to clarify that those routines munge data: If a character can't be converted to the target encoding , it is replace with a character that can . ** Logical Strings ** In the following example , ====== set mylist [list some huge list] set script "lappend somevar {*}[list mylist]" eval $script ====== A string representation is generated for `$script` , and that representation unfortunately includes the string representation of $mylist . In some future version of Tcl where each type of value has an interface which includes the standard operations of a string [abstract data type] , A "concatenated value" type could provide the logical equivalent of the string representation in `$script` while not actually generating the full string . This is one of the fundamental pieces that remains to be added to Tcl in order to give it more of the power of other [Lisp%|%Lisps] , making The Best Lisp (TM) . Another example: ====== proc p1 {} [list ::apply [list hugelist {lindex $hugelist 1}] $hugelist] p1 ====== Ideally this would not trigger the generation of a string representation for `$hugelist` . *** `package require` *** `[package require]` could return a [handle] for the required package . Commands that operate on a handle could include: `package namespace`: Returns the namespace of the loaded package . `package version`: Returns the version of the loaded package . *** sorted-aware lists *** Would this be a performance win in the large? *** Make [[upvar 0 othervar myvar]] work with [env] *** Also fix traces so that traces on the array , not just the individual element are fired for `$myvar` . [http://core.tcl-lang.org/tcl/info/572889] *** fix 1-argument invocation of `[uplevel]` *** Modify `[uplevel]` so that when only 1 argument is passed , it won't try to interpret that one argument as the optional ''level'' argument . *** Add Moose-like Convenience to a Tcl object system *** In the [Tcl Chatroom] on 2014-02-26 , mst described how convenient it is in Moose , an object system in Perl , to create objects with slots for lazy variables , which the ability , if desired , to initialize those variables at the time of object creation . I think something like that would be almost trivial to add to a Tcl object system , perhaps to [ycl]::ns::object [AMG]: How is this different than initializing those variables in the object's instance constructor ? [PYK]: mst described a system where the attribute would not be computed until first accessed , but then optionally could be initialized in the constructor . Apparently in Moose there is a nice terse syntax to express this . The difference , of course , might be felt when deriving the value is relatively costly , and that cost can be deferred until the value is actually needed , and then the value could be cached for future reference . [AMG]: This can be done with read [trace]s . *** Modify [tclsh] treatment of stdin *** Currently , tclsh switches to interactive mode whenever the Tcl script is read from stdin . This is even true when stdin is a pipeline . One consequence of the current behaviour is that when there are errors in a script that comes through a stdin redirection , the interpreter exit , or to display a stack trace . This can cause a script to behave quite differently depending on whether it is in a named file or redirected from stdin . *** Modify [tclsh] to accept scripts whose name begins with "-" *** [AMG]: I propose the opposite: make tclsh bail out if its arguments , prior to the filename , can't be interpreted as valid options . The current behavior is bizarre . If the first character of the first argument is "-" (and the argument's not "-encoding") , tclsh drops into interactive mode with all arguments placed in $argv . What good is this ? Right now the only supported option is "-encoding" . I'm not comfortable with allowing scripts whose names being with "-" because we unavoidably get in trouble when the script's name is "-encoding" . [PYK]: I don't think Tcl needs to do that much babysitting . If someone is reckless enough to both have a file named -encoding ''and'' be using `tclsh -encoding` , they're asking for it . On the other hand , why should Tcl be able to interpret any file , regardless of name ? [AMG]: Why "should" ? I'm going to assume you meant to say "shouldn't" . It may seem unfortunate , but every system must define some limits which its users must observe . In this case , Tcl doesn't allow the startup script's name to begin with a dash . This is done to avoid ambiguity with command-line options . There's an easy workaround though: prefix the script's name with "./" , an absolute path , or any other such construct containing a slash . Many other workarounds exist involve renaming , copying , linking , or sourcing the file . [RLE]: There is another alternative . First , tighten up tclsh's (and wish's) option parsing to accept only valid options and refuse invalid ones . Then add support for the "end of options" option "--" , at which point if one wants to have a script named -encoding , one would do: tclsh -- -encoding And if one wanted to set an explicit encoding , for a script named -encoding , one would do: tclsh -encoding utf-8 -- -encoding This would be consistent with a bunch of tcl commands that already implement the end-of-options option "--" , and with a bunch (most , at least of the GNU variety) command line programs that also accept the end-of-options option . *** memory characteristics of [string replace] *** In the following example , when the first command sets `b` , the memory usage quadruples . In the second example , it doubles . If possible , modify `[string replace]` so that the first example only doubles the memory usage while the second example doesn't change it . ====== set a [string repeat a 10000000]; set b [string replace $a[set a {}] 0 0 b] set a [string repeat a 10000000]; set b [string replace $a 0 0 b] ====== [AMG]: You sure you don't have that backwards ? I would expect the second line (example?) to cause the larger growth in memory because now both $a and $b contain 10000000-character strings . In fact , I just tested this on my system , and indeed it behaves as I describe . Run 1: ====== % set a [string repeat a 10000000] ; exec ps -o size --no-header [pid] 19000 % set b [string replace $a[set a {}] 0 0 b]; exec ps -o size --no-header [pid] 19044 ====== Run 2: ====== % set a [string repeat a 10000000]; exec ps -o size --no-header [pid] 19000 % set b [string replace $a 0 0 b] ; exec ps -o size --no-header [pid] 28768 ====== I'm not entirely sure I know what you're asking . My best guess is a request to make [[[string replace]]] not return a new pure string but rather some [Tcl_Obj] that references its source string value but contains an annotation saying to replace its first character with b when a string representation is demanded . Indeed that would cut memory usage in half for the examples you give , but creating a new "string replace result" [intrep] would be a special case of dubious benefit . Indeed , that benefit would vanish as soon as a string representation is needed , which will be pretty much right away , unless you were to never look at or use the value you got . [PYK] 2014-04-24: Yes , I had it backwards . My idea for improvement is that if the number of characters being substituted in is the same as the replacement value , and the object is unshared , could the string representation be modified in-place ? Those criteria should be true for the first example: ====== set a [string repeat a 10000000]; set b [string replace $a[set a {}] 0 0 b] ====== [AMG]: This first example already works just fine . My simple profiling above shows no appreciable increase in size . What's the problem ? *** Modernize [Ffidl] *** *** Fix [[[file link] -symbolic] *** so that it doesn't require the destination to exist in order to create the symlink *** Fix [[[trace]] facilities so that errors never disappear into a vortex *** Also work towards consistent behaviour of trace . Make sure commands like [[[append]] and [[[lappend]]] consistently trigger traces at the logical points . This is well-underway . See [https://pooryorick.com/fossil/Tcl%|%my branch] of tcl . *** Modify `trace add command ... enter somecommand` *** See proposal on the `trace` page to use the result of `somecommand` as the actual command to run *** Expect Bug *** ====== #! /bin/env tclsh package require Expect spawn tclsh; fileevent [set fh [open /dev/random]] readable {expect something {}}; vwait forever ====== *** eliminate newline substitution in comments ? (tclParse.c/ParseComment) *** [AMG]: How about eliminating backslash-newline substitution inside braces ? No one seems to know what it's good for , and it has caused strange problems for me with [templates and subst] . Specifically , long lines continued with backslash must have percent signs at the beginning of each physical line when the data is [[[read]]] in from disk and must ''not'' have percent signs at the beginning of subsequent lines when the data is inside braces . [PYK] 2013-03-08: That's an interesting point . I'd never really paid attention to that , but now that you mention it , it does seem odd/useless/obstructive . Maybe it's just an artifact of the original implementation of the parser . If anyone out there can shed more light on the subject , feel free to comment on this page , and I might move the discussion to another page later . [PYK] 2013-04-15: I found an example of backslash-newline substitution being put to use at [cmdSplit%|%scriptSplit] , where it allows the error message to be indented in the source code , but come out de-indented at runtime . That use case led me to wonder if the \whiteSpace rule shouldn't be changed to \\*whiteSpace instead [AMG]: Even if backslash-newline substitution inside braces were to be eliminated , the code you reference would still produce error messages all on one line , with indents and line breaks removed . This is because the parser already has special handling for backslash-newline-whitespace when outside braces . Inside quotes , it's a single space . Outside , it's a word (argument) separator . I find it redundant and destructive to do this processing at multiple layers of interpretation . *** write a port of the DOS game , Slicks'n'Slides , as mentioned at [Car racing in Tcl] *** *** a Tcl alternative to [TeX] *** [AMG]: Great idea , I had been considering the same thing . But perhaps there's a way to make a Tcl frontend for TeX or for one of the frontends TeX already has (e.g. [LaTeX] or [DocBook]) ? [PYK]: I think a front-end for TeX would most definitely be the way to start . [PYK] 2014-08-19: Another starting point might be to write a Tcl [http://patoline.org/%|%patoline] extension and build on that *** Tcl implementation in RPython . May involve writing a Tcl analogue to Rpython *** *** `[[binary set]]` *** [AMG]: I assume this would modify individual bits and fields of a structure in-place , thereby avoiding the need to reconstitute the entire structure each time a piece has to change . Kind of like `[[[lset]]]` ... [PYK]: right . *** fix [lindex] so that [[lindex $somevalue]] throws an error if `$somevalue` is not a list *** [AMG]: I'm assuming you're talking about single-argument [[[lindex]]] which simply returns its argument . What's the problem with that ? I believe it currently has the correct behavior . [[lindex]]'s subsequent arguments specify what list indexes should be applied , so if there are no list index arguments , no list indexing should be applied . If no list indexing should be applied , there should be no requirement that the data be a list . Let's look at it from another perspective . Take this code: ====== lindex {{{asdf}fff}} 0 ====== This returns `{asdf}fff` , since that is the one (and only) element of [[lindex]]'s first argument , which is indeed a list . The fact that `{asdf}fff` itself isn't a list is totally irrelevant . But then take this: ====== lindex {{{asdf}fff}} 0 0 ====== Now we have a problem . [[lindex]] is being asked not to return `{asdf}fff` but instead to drill inside it and take its first element . Since it's not a list , there is an error . In summary , it's already the case that [[lindex]]: 1. is capable of returning values that aren't lists , and 1. is unconcerned about the listhood of values (or nested values) when it's not being asked to index into them . I see no reason to special-case the situation where [[lindex]] is given only a single argument . [PYK] 2014-08-22: I've since become accustomed to using `[lindex]` as the [identity function] , and because anyone providing it with ony 1 argument has surely read the documentation , I no-longer see it as broken . So now , on with the critique of your analysis ! The fact that elements of a list don't themselves have to be lists isn't particularly relevant to the argument , and `[lindex]` without an argument already is a special case , both because it is the only time that `[lindex]` isn't actually being asked to return an element from a list , and because it's the only time that the first argument is not required to be a list . This special case is a hole that like other such holes , was ingeniously exploited . It's an easter egg , and a very useful one that spices up any script with a touch of wizardry . [AMG]: I argue the opposite , that single-argument [[[lindex]]] is not a special case nor a hole but rather a natural consequence of the generality of [[lindex]]'s definition . Furthermore , I argue that the fact it doesn't require its lone argument to be a list is to be a direct consequence of that same definition . I know I'm repeating myself , but I'll try it anyway to see if I can make my point clearer . [[lindex]] must be given one data argument followed by any number (even zero) of list index arguments . Initially , [[lindex]] lets the data argument be the tentative result . For each index argument ''n'' , [[lindex]] obtains the nth element of the result and lets it be the new result . That's almost the entire definition . The only part I left out is that the indexes can either be separate arguments or a single list . From this I'm sure you can see that if there are no index arguments , no list indexing is performed . And if no list indexing is performed , there's no need for the first argument to be a list . It's the result and that's the end of the story . As for your argument , I will now use similar logic to show that four-argument [[lindex]] is a special case . It's the only time [[lindex]] is being asked to return an element from a list in a list in a list , and it's the only time its first argument is required to be a list nested minimum three levels deep along the selected path . Basically I'm saying that the number zero is no more special than the number three . [PYK] 2014-08-23: That is a most illuminating and satisfying reply . As long as `[lindex]` is going to accept only 1 argument , that operational description of why the current behaviour is the correct behaviour makes perfect sense . I appreciate the twist on my logic for the four-argument case , but it had to drop the key word , '''isn't''' , for the word '''is''' . Saying that `[lindex]` is implicitly not being asked to extract anything from its final result is a bit of a tautology — but wait — what could be more fitting than a tautology to express an identity ? I give up ! *** [[lsearch -filter]] . Or even better , have [lindex] interpret its arguments as lists of indexes *** [AMG]: [[[lindex]]] already supports having an ''indexList'' argument , and [{*}] can be used to make any argument work as an index list . Please post an example showing what you have in mind . [PYK]: I mean that ====== lindex {uno dos tres quatro} {1 3} # -> {dos quatro} ====== For compatibility with current usage , it might have to be ====== lindex {uno dos tres quatro} {{1 3} {}} #-> {dos quatro}] ====== [AMG]: Ah , we're talking about two different kinds of index lists . I was talking about a list of indices forming a path to a single element located within nested lists . You're talking about indexing multiple elements . The [[[lmap]]] command may help: ====== proc lindex_multi {data indexes} { lmap index $indexes {lindex $data $index} } lindex_multi {uno dos tres quatro} {1 3} ====== *** A Tcl implementation of or binding for a [http://en.wikipedia.org/wiki/Hierarchical_temporal_memory%|%hierarchical temporal memory] system *** *** Contribute to a Tcl project competing with [http://pandas.pydata.org/%|%pandas] *** ** Messages ** ** Archived Discussions ** The discussions below have been archived at the the indicated revisions of this page . [https://wiki.tcl-lang.org/revision/Poor+Yorick?V=553%|%revision 553]: Conversations through 2018. [https://wiki.tcl-lang.org/revision/Poor+Yorick?V=550%|%revision 550]: Conversation regarding modernizing scripts on wiki pages. <> Person