apocalypse~r
Joined: 21 Jun 2007 Posts: 41 Location: 43.074233,-72.424707
|
Posted: Fri Jul 04, 2008 7: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
(problems != 0) ? code := debug(code) : celebrate()
--
humor for: 1. Programmers 2. Everyone |
|