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

bachmeier no at spam.net
Tue Dec 3 18:47:06 UTC 2019


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.

> 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:
>
> https://github.com/dragon-lang/mar/blob/master/test/go.d

But you were able to do that without rdmd.



More information about the Digitalmars-d mailing list