fulvio ciriaco wrote:
Hallo! I think I discovered two bugs. I am using gpc-970714 beta version,on digital alpha unix. The first is very strange: var i:integer; read(f,i); reads 110 in i if the file f begin with 10 but correctly reads 10 if f contains <space>10 The second is schematized in the following PROCEDURE readdata; VAR f : bindable text; c : BindingType; i : integer; BEGIN WRITELN('dammi il file di input'); READLN(c.name); bind(f,c); SeekRead(f,0); END; PROCEDURE printdata; VAR f : bindable text; c : BindingType; i : integer; BEGIN WRITELN('dammi il file di output'); READLN(c.name); bind(f,c); SeekWrite(f,0); END;
f I believe should be local to readdata and printdata, but calling printdata after readdata gives the error ?Gpc: Object (0x11ffffba8) already bound to `inizia' where inizia is the input file name.
The reason for this problem is the list Bound_objects in the RTS which stores the addresses of all bound files with their names. The two files in the two procedures incidentally get the same address, so the RTS "thinks" they're the same.
I don't know much about bindings and so, but I think it would be better to store the binding information only in the Text variables themselves, not (additionally) in a global list. So I'm asking the long-time GPC developers: is there any reason against removing the list, and Bound_free_list as well?