Am 04.07.2013 15:37, schrieb Massimo Manghi:
> parse -string $template
> 
> as opposed to the usual
> 
> parse <filename>
> 
> Command 'parsestr' doesn't cache the template leaving to the caller (the
> application) the task to devise a possible way to cache it consistently,
> when needed.

Sorry, Massimo, I did not get it...

1) Cache: what is cached:
1.a) the verbatim .rvt file?
1.b) or the parsed html output of the rvt. file ?

I would consider 1.b) as quite dangerous, as already a
"<? [clock now] ?>" would not work any more...

2) About the new command "parse -string xxx" -
This sounds logic to me. We have something like "<bod><h1><? db get
header ?></h1></body>" in a data base and then, put it into the tag
replacement, so essentially do:
subst $template
where the command tags are not "[]" but "<??>".

Ok, in which scope, the tags are evaluated ?
2.a) current scope
2.b) global scope

I think this is useful, no issue Massimo.

So parse may be implemented as:
proc parse filename {
    set f [open $filename r]
    set res [parse -string [read $f]]
    close $f
    return $res
}

Thank you,
Harald

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to