You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My suggestion would be to let the legacy '$INCLUDE: metacommand stay the way it is. Instead, we can have a QB64 style metacommand $INCLUDEONCE: to include files only once. Alternately, we can do it like most modern C++ compilers do it with #pragma once. So, we can have the meta command like $INCLUDEONCE which when detected would ignore the file if it were already included.
It would be fantastic if we had a pre-compiler statement that made sure the file being
$INCLUDE
d is only included once.In C this is
#pragma once
I believe.Why would it help?
We could avoid having to handle our own defines all over our code.
Here is an example of where I have had to implement my own include "guards":
Once at the top of the file for the
.BI
:From: https://github.com/grymmjack/QB64_GJ_LIB/blob/ad1a293001575a705daf718a6d68da79ec4c2f58/ANSI/ANSI.BAS#L13
Then at the bottom of the file for the
.BM
:https://github.com/grymmjack/QB64_GJ_LIB/blob/ad1a293001575a705daf718a6d68da79ec4c2f58/ANSI/ANSI.BAS#L793
I know this is an extreme case, but my library could be cleaned up quite a bit if we just had a feature like this.
Thanks for listening!
The text was updated successfully, but these errors were encountered: