feature request: nim's compilation option pragmas

Basile B. via Digitalmars-d digitalmars-d at puremagic.com
Sun Dec 18 03:10:42 PST 2016


On Sunday, 18 December 2016 at 04:46:34 UTC, Timothee Cour wrote:
> Could we support something similar to nim's compilation option 
> pragmas [1]:
>
> ```
> {.push checks: off.}
> # compile this section without runtime checks as it is speed 
> critical
> # ... some code ...
> {.pop.} # restore old settings
> ```
>
> in D could look like:
>
> ```
> pragma(push, "-noboundscheck -O -release");
> // compile this section with specified flags as it's critical
> pragma(pop);
> ```
>
> [1] 
> http://nim-lang.org/docs/manual.html#pragmas-compilation-option-pragmas

Afaik this Nim feature is inspired from Object Pascal: 
http://www.freepascal.org/docs-html/3.0.0/prog/progsu63.html.



More information about the Digitalmars-d mailing list