apocalypse~r
Joined: 21 Jun 2007 Posts: 19
|
Posted: Fri Jul 04, 2008 8:41 am Post subject: Recursive Expressions |
|
|
when a variable is derefed as part of an expression, like this:
| Code: | expression := "x"
x = 4
var := %expression% |
it evaluates to 4, because that expression is basically the same as:
-but-
when an expression inside a variable is derefed as part of an expression (a recursive expression is called), like this:
| Code: | x = 4
expression := "x * 3"
var := %expression% |
which would logically be evaluated as:
it causes an error, because ahk thinks that only a variable can be dynamically referenced. If the system is chanced so that when the := operator is found, the right side is then evaluated as a string (adding compatibility for expressions like:
| Code: | var := "x * 3"
ans := %var% |
while keeping support for dynamic variable references like:
| Code: | fred := "bob"
ans := %fred%
ans := name%fred%. |
) _________________ problems := bugs + errors + glitches
code := (problems != 0) ? debug(code) : celebrate() |
|