Re: Using the C preprocessor with D code

2017-04-06 Thread Patrick Schluter via Digitalmars-d
On Thursday, 6 April 2017 at 01:21:48 UTC, Walter Bright wrote: On 4/5/2017 1:50 PM, H. S. Teoh via Digitalmars-d wrote: Who says you can't use a preprocessor with D code? ;-) There are some issues with it. The C preprocessor is defined to work on "preprocessor tokens", which are not quite

Re: Using the C preprocessor with D code

2017-04-05 Thread H. S. Teoh via Digitalmars-d
On Wed, Apr 05, 2017 at 06:21:48PM -0700, Walter Bright via Digitalmars-d wrote: > On 4/5/2017 1:50 PM, H. S. Teoh via Digitalmars-d wrote: > > Who says you can't use a preprocessor with D code? ;-) > > There are some issues with it. The C preprocessor is defined to work > on "preprocessor

Re: Using the C preprocessor with D code

2017-04-05 Thread Walter Bright via Digitalmars-d
On 4/5/2017 1:50 PM, H. S. Teoh via Digitalmars-d wrote: Who says you can't use a preprocessor with D code? ;-) There are some issues with it. The C preprocessor is defined to work on "preprocessor tokens", which are not quite the same thing as text.

Using the C preprocessor with D code

2017-04-05 Thread H. S. Teoh via Digitalmars-d
D doesn't have a preprocessor, and for good reason, as it can allow all sorts of hard-to-find bugs and other issues that make code hard to maintain / understand. However, some time ago I found an occasion where it was useful to run D code through a C preprocessor before handing it to the D