Using the C preprocessor with D code

Patrick Schluter via Digitalmars-d digitalmars-d at puremagic.com
Thu Apr 6 08:39:03 PDT 2017


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 the same 
> thing as text.

I did this kind of things in the '90s with 2 very different 
languages AutoLISP and Foxbase. Worked really well and allowed to 
avoid a lot of code duplication. These 2 languages were very 
deficient when speaking about modularity and global symbols of a 
project. There were really only 2 or 3 small things that couldn't 
be used with the macros. Syntactically D is much, much closer to 
C than Lisp or dBase language.



More information about the Digitalmars-d mailing list