Forum OpenACS Development: Response to eval, apply (lack of) safety

Collapse
Posted by Cristian Petrescu-Prahova on
You are right. I don't think that there are any problems with the acs. I had some problems with my own attempt to use eval (i am writing a little parser for some wiki processing and i need to call actions). There are still some subtle points I don't quite get with tcl and eval. For instance:

% eval set test "[expr 1 + 2]"
3
% proc eval_test {func args} {
    set cmd [concat [list $func] $args]
    puts $cmd
    uplevel $cmd
  }
% eval_test set test "[expr 1 + 2]"
set test {[expr 1 + 2]}
[expr 1 + 2]
So eval_test is not equivalent with eval, as you already mentioned.

The only place where eval is used pervasively is in the cms, for instance all element calls goes through one eval. But it is used as in eval_test, so there are no problems.

Anyway, thanks for the explanations.

Cristi