I have a few Ada questions that I’ll just summarize in one post.
If I always have to completely rewrite a file, then it makes no difference whether I use Open or Create. Is that correct or did I miss something?
Currently I use Stream_IO to write files, the files contain different data types. Do other writing methods, such as Sequential_IO, produce smaller files that justify the extra effort to use them? Or are they practically all equally efficient?
I use Pure, Preelaborate and Elaborate_Body whenever possible. However, I have some files that don’t allow Pure/Preelaborate and since they don’t have a body, Elaborate_Body isn’t possible either. However, I would still like to know if there is a circular dependency. Are there any other options besides giving all files a body?
Is there a standard function that returns the number of elements in an enum subtype, or do I have to write it myself?
The binding stage will report failure. The last time I had this (many years ago) the report was accompanied by a long list of packages which was supposed to help finding the problem. To be fair, I think it did - after much headscratching
I don’t know if there is an intended efficiency difference between sequential_io and stream_io. It would probably depened on the implementation and need benchmarking. I think they were more likely designed with code writing efficiency in that if you already had a stream and wanted to write a binary file, you can use stream_io, but if you didn’t have a stream and just wanted to write a type to a file, then you could use sequential_io. It wouldn’t surprise me if an implementation used one to create the other even, though I don’t know if they do.