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

exportSince: (1, 5, 1): export when nimversion >= (1,5,1) #479

Open
timotheecour opened this issue Dec 24, 2020 · 0 comments
Open

exportSince: (1, 5, 1): export when nimversion >= (1,5,1) #479

timotheecour opened this issue Dec 24, 2020 · 0 comments

Comments

@timotheecour
Copy link
Owner

timotheecour commented Dec 24, 2020

Example

proc fn*(a: int) = discard
proc fn(a: float) {.exportSince: (1,5,1).} = discard

behavior: this exports a symbol when nimversion >= (1,5,1)

Note: the pragma should only affect the symbol for which the pragma applies, which is tricky in the case of overloads.

implementation

using this PR nim-lang#12076 we can write:
resolveSymbol(fn(float.default)) to pick a particular overload, and then a macro to export that particular overload (a symbol) can be written.

links

exportSince
https://github.com/nim-lang/Nim/pull/13044/files#r368188265

see also nim-lang#16044 (comment)

since has a serious design flaw, it should only disable the export marker when used with --useVersion so that it can be used regardless in the same module. I know it doesn't help stdlib clients of the module but it would help. This probably means that since should come a compiler builtin...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant