How do people feel about putting source compiler directives inside rdmd?

aliak something at
Tue Dec 3 20:54:19 UTC 2019

On Tuesday, 3 December 2019 at 18:47:06 UTC, bachmeier wrote:
> On Tuesday, 3 December 2019 at 16:45:52 UTC, Jonathan Marler 
> wrote:
>>> None of this is relevant if you have a tool that is limited 
>>> to running code that doesn't need compiler directives. I'm 
>>> aware that some people think you have to add every feature to 
>>> every tool. I disagree. Especially in cases where the 
>>> functionality is already provided by other tools.
>> This is true in most cases.  The problem is that some 
>> requirements of a D program can't be configured in the source 
>> file.  They can only be specified on the command-line.
>> For example, if you have a D program that requires -betterC, 
>> you couldn't declare this source file itself.  You can't 
>> specify import paths, versions and many other options in the 
>> source file.
> Why is it necessary to do this with rdmd? Aren't there already 
> tools that do this? I'm honestly surprised that someone using 
> -betterC would even want a script.

There are always going to be people who use tools in ways that 
you don't - probably, the majority of use cases are not your use 

While person A will make a makefile and source file, and have the 
user download it, run make, install, and then be able to run it, 
person B will use a tool that allows their users to "just run it".

>> Not all programs need to specify any of these options, but 
>> some do.  Here's an example of a D script that requires import 
>> paths, a version, betterC, and no dmd.conf file:
> But you were able to do that without rdmd.

You asked for compiler source directive use cases.

And yes, point being he can't use rdmd for writing the scripts he 
needs to write.

More information about the Digitalmars-d mailing list