Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: c1d5cbd21ebaab2828449531540998f9a394a068
Ticket: 2314561fffffffffffffffffffffffffffffffff
TODO: NRE-enable [subst]
User & Date: dkf on 2009-07-18 20:58:55
Changes

  1. icomment:
    A bit deeper explanation about why this matters.
    
    Tclhttpd is used a fair bit to handle custom application-on-the-www scenarios, and the most common way of using it that way is to write the pages in TMML, which involves the use of [subst]. Something that's often desired is a way to stop the processing of a page for a while until some other processing (e.g., running a subprocess) is finished; right now, with tclhttpd they're doing this by using [vwait] recursively (inside another procedure call). If we could [yield] during [subst]-processing, then it would be possible to change the template processing library so that tclhttpd/tmml doesn't have this nasty recursive-vwait case without having to rewrite lots of existing pages that are already in production.
    
    I've thought a bit about what it would take to make [subst] more efficient in the past. Possibilities included directly bytecoding it, but almost all substantive (and interesting) cases use a non-constant template. Hence it's probably good enough to convert the template to something with an internal rep that has three sub-components: ordinary string, variable substitution, command substitution (all modulo the options). It would then be possible to just concatenate these bits appropriately (and quickly) to make the result, and doing so in an NRE-aware way would be straight-forward too (only affects command substitutions as var traces aren't NRE-aware).
    
    The parser is sufficiently complex that the conversion to the above-mentioned sequence form is beyond what I can do in a small amount of effort, hence dropping it on your lap, Don. :-)
    
    
  2. login: "dkf"
  3. mimetype: "text/plain"
  4. username: "dkf"