Hi,
So here it is: Pike v7.4 release 20 running Hilfe v3.5 (Incremental Pike Frontend)
float x; int n; x = 1.0;
(1) Result: 1.000000
n = 1; while (x != x + 1.0) { x *= 10.0; n++; }; n;
(2) Result: 1 Compiler Error: 1:Undefined identifier x. (3) Result: 1
Variable "x" is declared and accessible (1). I do something wrong? Regards, /Al
No, it's a Hilfe bug.
float x=1.0; int n=1; while (x != x+1.0) { x *= 10.0; n++; }
Compiler Error: 1:Undefined identifier "x".
dump wrapper
Last compiled wrapper: 001: #pragma unpragma_strict_types 002: mapping(string:mixed) ___hilfe = ___Hilfe->variables; 003: # 1 004: mixed ___HilfeWrapper() { while ((([mapping(string:float)]___hilfe)->x) != (([mapping(string:float)]___hilfe)->x)+1.0) { x *= 10.0; (([mapping(string:int)]___hilfe)->n)++; } ; } 005:
As you can see the variable rewriter code for some reason interprets the x in the while loop as being in the inner scope.
/ Martin Nilsson (saturator)
Previous text:
2003-09-14 17:09: Subject: Another problem with hilfe (7.4.20?)
Hi,
So here it is:
Pike v7.4 release 20 running Hilfe v3.5 (Incremental Pike Frontend)
float x; int n; x = 1.0;
(1) Result: 1.000000
n = 1; while (x != x + 1.0) { x *= 10.0; n++; }; n;
(2) Result: 1 Compiler Error: 1:Undefined identifier x. (3) Result: 1
Variable "x" is declared and accessible (1). I do something wrong?
Regards, /Al
/ Brevbäraren
pike-devel@lists.lysator.liu.se