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.

My apologies for being so long winded. I asked the questions originally, but I thought others might find my conclusions to be useful.

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 - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.

Reply via email to