Re: Alternative to C++ macro in D

2019-11-09 Thread Vinod K Chandran via Digitalmars-d-learn
On Monday, 4 November 2019 at 00:20:37 UTC, Ali Çehreli wrote: On 11/03/2019 08:55 AM, Vinod K Chandran wrote: > [...] There is nothing that stops one from using the C++ preprocessor on any text file. For example, you can do the following wherever GCC exists. If there are the following lines i

Re: Alternative to C++ macro in D

2019-11-03 Thread Ali Çehreli via Digitalmars-d-learn
On 11/03/2019 08:55 AM, Vinod K Chandran wrote: > Hi all, > I can do this in C++. > #include > using namespace std ; > > #define end }; > #define log(x) cout << x << endl > #define wait std::cin.get() There is nothing that stops one from using the C++ preprocessor on any text file. For example

Re: Alternative to C++ macro in D

2019-11-03 Thread Meta via Digitalmars-d-learn
On Sunday, 3 November 2019 at 16:55:36 UTC, Vinod K Chandran wrote: Hi all, I can do this in C++. #include using namespace std ; #define end }; #define log(x) cout << x << endl #define wait std::cin.get() int main() { log("Trying to avoid the visual clutter aused by closing curly braces

Re: Alternative to C++ macro in D

2019-11-03 Thread Sebastiaan Koppe via Digitalmars-d-learn
On Sunday, 3 November 2019 at 16:55:36 UTC, Vinod K Chandran wrote: int main() { log("Trying to avoid the visual clutter aused by closing curly braces") ; string myStr = "Now, code looks more elegant" ; log(myStr) ; wait ; end How can i do this in D ? Especially the " #define en

Re: Alternative to C++ macro in D

2019-11-03 Thread Alexandru Ermicioi via Digitalmars-d-learn
On Sunday, 3 November 2019 at 16:55:36 UTC, Vinod K Chandran wrote: Hi all, I can do this in C++. #include using namespace std ; #define end }; #define log(x) cout << x << endl #define wait std::cin.get() int main() { log("Trying to avoid the visual clutter aused by closing curly braces

Re: Alternative to C++ macro in D

2019-11-03 Thread Alexandru Ermicioi via Digitalmars-d-learn
On Sunday, 3 November 2019 at 17:02:30 UTC, Vinod K Chandran wrote: On Sunday, 3 November 2019 at 16:55:36 UTC, Vinod K Chandran wrote: Hi all, I can do this in C++. #include using namespace std ; #define end }; #define log(x) cout << x << endl #define wait std::cin.get() int main() { l

Re: Alternative to C++ macro in D

2019-11-03 Thread Vinod K Chandran via Digitalmars-d-learn
On Sunday, 3 November 2019 at 16:55:36 UTC, Vinod K Chandran wrote: Hi all, I can do this in C++. #include using namespace std ; #define end }; #define log(x) cout << x << endl #define wait std::cin.get() int main() { log("Trying to avoid the visual clutter aused by closing curly braces

Alternative to C++ macro in D

2019-11-03 Thread Vinod K Chandran via Digitalmars-d-learn
Hi all, I can do this in C++. #include using namespace std ; #define end }; #define log(x) cout << x << endl #define wait std::cin.get() int main() { log("Trying to avoid the visual clutter aused by closing curly braces") ; string myStr = "Now, code looks more elegant" ; log(myS