-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C like conditional compilation and suggested features #406
Comments
It is a feature that I'd like to add to Gravity, but I don't want to increase the complexity of the code. |
I agree that keeping it simple is the way to go and yeah fully recreating C like macros would be overkill. I was thinking that there should be //I wouldn't allow this (simplified platform macros)
#define IS_COMPATIBLE OS_WINDOWS && OS_64BIT
//I would only allow this
#define IS_COMPATIBLE 1 //or 0, true and false keywords should also work
//Setting macro values should also be possible via gravity vm's functions
#if IS_COMPATIBLE
//...
#else
//...
#endif
//Should other operations be allowed? like:
#if COMPILER_VERSION < 1000
#if COMPILER_VERSION != 1000
//etc Personally I would also add //C# version
[Serializable]
public class SampleClass
{
// Objects of this type can be serialized.
} //Example Gravity version
@serializable
class SampleClass
{
//...
} Also is it possible to save bytecode and then run it via some function or does the API only allow loading the source? |
Are there any plans to add macros such as #define, #if, #elif and #endif or some other alternative to allow conditional compilation?
Also is this project still continued since there weren't any updates lately?
The text was updated successfully, but these errors were encountered: