Overall, I'm fairly happy with the results of Parser BC. I would think it would be possible to gain even further benefits if it were implemented in C (like ns_adp_parse and ns_adp_include). Additionally, if they are not currently, I think all 3 of them would benefit from being implemented as object commands as well as generating object based command byte codes. This is incredibly useful stuff, thanks for putting it all together. I was wondering if you could benchmark a [subst ] implementation of including content, something like this so: === proc header {title time } { return [subst {<title>$title</title> The current time is [clock format $time] <hr>}] } ns_adp_puts [header "test" 100] === this is uses the Tcl-standard format for inline code, rather than <% code %>, and unlike your example, which uses "append" statements to build a string. I don't know how smart Tcl is with its bytecode, whether it's able to retain the bytecode form of the html string with its embedded tcl command, or whether that's scanned every time. For that matter, you can use this [subst] technique on a file, like so: ns_adp_puts [read_file "header.tml"] where header.tml is an html file, with code in [brackets] and $variables sprinkled within. -john
|
- [AOLSERVER] ns_adp_parse Robert Seeger
- [AOLSERVER] ns_adp_parse Robert Seeger
- Re: [AOLSERVER] ns_adp_parse John Buckman
