Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nim language manual, push pragma is not explained well #10824

Closed
StefanSalewski opened this issue Mar 11, 2019 · 0 comments · Fixed by #12437
Closed

Nim language manual, push pragma is not explained well #10824

StefanSalewski opened this issue Mar 11, 2019 · 0 comments · Fixed by #12437
Labels
Documentation Content Related to documentation content (not generation). Hacktoberfest (Open) Issues suitable for Hacktoberfest, open for working on.

Comments

@StefanSalewski
Copy link

https://nim-lang.github.io/Nim/manual.html#pragmas-push-and-pop-pragmas

From explanation I always get the wrong feeling that push works for options only like

{.push checks: off.}

But works for many pragmas, for example this works fine:

{. push inline.}
proc t1: int = 0
proc t2: int = 1
{. pop.}
proc t3: int = 2

echo t1()
echo t2()
echo t3()

And this section is not absolutely clear also:

https://nim-lang.github.io/Nim/manual.html#pragmas-compilation-option-pragmas

"The listed pragmas here can be used to override the code generation options for a proc/method/converter."

{.checks: off, optimization: speed.}

So does this apply only to the next proc/method/converter or to whole module? From explanation I would assume only to next, but I have the feeling it applies to all code after pragma location?

@andreaferretti andreaferretti added the Documentation Content Related to documentation content (not generation). label Mar 12, 2019
@narimiran narimiran added the Hacktoberfest (Open) Issues suitable for Hacktoberfest, open for working on. label Oct 1, 2019
Araq pushed a commit that referenced this issue Oct 17, 2019
narimiran pushed a commit to narimiran/Nim that referenced this issue Oct 17, 2019
(cherry picked from commit 4d1f69c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Content Related to documentation content (not generation). Hacktoberfest (Open) Issues suitable for Hacktoberfest, open for working on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants