>Phil Housley <[email protected]> writes: > >> Aside: The following doesn't work: >> >> public void main() { >> float flt = 9.12f; >> var output = FileStream.open("./data.txt","w"); >> output.printf("%f", flt); >> float in_flt = 5f; >> var input = FileStream.open("./data.txt", "r"); >> int read = input.scanf("%f", out in_flt); >> message("%d %f", read, in_flt); >> } >> >> Because in the generated C, the output file isn't closed before >> attempting to read. This is a sort-of-bug, as there is no way to >> explicitly close a FileStream... > >There is a way to close the output file > > output = null; > >as fclose is declared a free_function for FileStream.
This breaks experimental non-null checking; keeping in mind the word 'experimental' I may suppose, that some day this will not be experimental any more and will become part of language. (BTW. using nullable variables is now extremely inconvenient in non-null mode, so I'd not advise to make 'output' nullable). best regards, -- Mój klucz publiczny o identyfikatorze 1024D/E12C5A4C znajduje się na serwerze hkp://keys.gnupg.net My public key with signature 1024D/E12C5A4C is on the server hkp://keys.gnupg.net
signature.asc
Description: PGP signature
_______________________________________________ vala-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/vala-list
