-
Couldn't load subscription status.
- Fork 1.1k
Closed
Labels
syntaxSuggestions to improve the syntaxSuggestions to improve the syntax
Description
Describe your issue/suggestions
There are conditional inclusions in C++ looks like this
#if defined(CREDIT)
credit();
#elif defined(DEBIT)
debit();
#else
printerror();
#endifI think this is extremely helpful for Wenyan when it comes to stdlib. For example, we can have (I keep the same syntax in C++ for better demonstration, we may discuss the syntax later)
今有一術。名之曰「左移」。欲行是術。必先得二數。曰「甲」。曰「乙」。乃行是術曰。
#if TARGET_LANG = py
施「(lambda x: lambda y : x<<y)」於「甲」。於「乙」。名之曰「丙」。乃得「丙」。
#elif TARGET_LANG = js
施「(x=>y=>(x<<y))」於「甲」。於「乙」。名之曰「丙」。乃得「丙」。
#else
吾有一言。曰「「NOT SUPPORTED」」。書之。
#endif
是謂「左移」之術也。This makes the stdlib more maintainable and also opens more possibilities for different use cases.
Checklist
Before you create this issue, Please make sure ALL the following items are checked
Metadata
Metadata
Assignees
Labels
syntaxSuggestions to improve the syntaxSuggestions to improve the syntax