Forum OpenACS Development: Response to Quoting curly braces in adp:s

Collapse
Posted by Peter Marklund on
I changed the proc to use upvar instead:
ad_proc -private template::adp_quote_chunk { chunk_var_name quoted_var_name } {
  Quotes (precedes by backslash) all square brackets, curly braces, 
  double quotes, backslashes, and dollar signs in a chunk of adp.

  @param chunk_var_name  The name of the variable to quote
  @param quoted_var_name The name of the variable to put the quoted result in

  @author Peter Marklund (peter@collaboraid.biz)

  @creation-date 2002-10-16
} {
  upvar $chunk_var_name chunk $quoted_var_name quoted

  regsub -all {[][{}"\$]} $chunk {\&} quoted
}
and calling the proc now becomes:
adp_quote_chunk remaining remaining_quoted
Does using upvar consume less memory, is it faster? Should I be using upvar here?