Hi,
Stefan Sayer wrote:
One problem is though, how to prevent this evaluation from happening -
if you really want to have the string "3+4" in the variable - with your
patch, you can't (with the 'set' function at least). so I am wondering
whether it is not better to add some eval() function. Also, there is
Wouldn't it probably be a good idea to quote strings anyways in all
functions? That way, we could always evaluate all non-quoted parameters
and treat quoted ones as strings? This would be consistent to other kind
of programming languages also.
some (minor) performance penalty involved when you need to search all
strings for '+' or '-' in every "set".
You're right, but is this really an issue here? Because I'd even go a
step further and evaluate *every* string being passed to a function. At
the moment,
set($bar=something);
log(2, foo=$bar);
will result in "foo=$bar" instead of "foo=something", as far as I've
seen. What would be cool though is something like
set($bar=something);
log(2, "foo=" . $bar);
resulting in "foo=something".
Do you think this is worth the effort? I mean, a workaround is always
something like
py(dsm.log("foo=%s" % session.var('bar')));
It's just a matter of how far we want to push the syntax of DSMs.
By the way, speaking of mod_py: it only seems to be possible to access
local vars (the ones with $xxx) with session.var(...), but not selects.
So to log the called user, I need to do
set($my_us...@user);
py(dsm.log("user=%s" % session.var('user')));
Or is there another function for that, which I just overlooked?
Andreas
_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev