-
Notifications
You must be signed in to change notification settings - Fork 23
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
Document defines #124
Comments
cc/ @timotheecour |
I completely agree with the general idea; I have some comments on specific aspects. Note: it's more like a declaration rather than a documentation (documentation is a side effect), just like in:
not in any measureable way, no
that would only be the case if it's used in package A and package B and A and B don't coexist in the same application; as soon as they are, you have a potential bug; so that's not a valid argument against your proposal.
we don't want yet another binary for many reasons (costly to build, has to stay in sync with compiler etc); instead this is a more scalable approach: #123
Note: we already have
note: instead of note
issue warning for
|
I have an alternative proposal that I think is significantly easier: Currently
Note that the issue of attaching documentation would now just be a matter of adding a normal doc comment to the symbol with a The original proposal has the issue that it's not clear if |
Please note that defines are documented here: https://nim-lang.org/docs/nimc.html#additional-compilation-switches There are lots of others, but they almost all use the |
@GULPF I really like your proposal;
I'm assuming u mean this as a place holder fo {bool,int,str}define, right?
so... let's just go with @GULPF 's proposal then? |
Yes |
This RFC is stale because it has been open for 1095 days with no activity. Contribute a fix or comment on the issue, or it will be closed in 7 days. |
Again fwiw we can use |
Document defines
Abstract
I propose that a mechanism be created to uniquely document
define
s (the flags passed to the compiler with-d
).nim doc
maybe?)I don't know the best syntax for this, but something like:
Motivation
define
s that are undiscoverable by other users.define
that already has another use (that you're not aware of)define
flags to become out of date. Documenting near thedefine
s use might make it easier to keep documentation up to date.define
flagsdefine
flags without having to add extra documentation in distant files or docstrings.define
Downsides
Examples
A potential documentation tool
Documenting all defines imported by
mylib.nim
:Trying to compile fails because
logGC
is already used for something:Backward incompatibility
My track record for detecting backward-incompatibility isn't very good, but since the definitions aren't currently being used, backward compatibility will only be introduced as each individual flag is documented.
The text was updated successfully, but these errors were encountered: