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

Documentation nonexistent quitprocs module #14331

Closed
juancarlospaco opened this issue May 13, 2020 · 4 comments
Closed

Documentation nonexistent quitprocs module #14331

juancarlospaco opened this issue May 13, 2020 · 4 comments

Comments

@juancarlospaco
Copy link
Collaborator

@timotheecour
Copy link
Member

my guess is that this was never committed to nim repo, according to git log -SaddQuitClosure, and that @Araq probably has this implemented in one of this branches (and committed the docs https://nim-lang.org/docs/quitprocs.html) but it never made it to Nim.
@Araq maybe you can have luck with git log -SaddQuitClosure --all in your local Nim repo?

@Araq Araq closed this as completed in a3719df May 13, 2020
@timotheecour
Copy link
Member

  • new modules should be under std => lib/std/quitprocs.nim instead of lib/pure/quitprocs.nim

  • this is useful but also a bit buggy:

import std/quitprocs

proc fun1() {.noconv.} = echo "ok1"
proc fun2() = echo "ok2"
proc fun3() {.noconv.} = echo "ok3"
proc fun4() = echo "ok4"

addQuitProc(fun1)
addQuitClosure(fun2)
addQuitProc(fun3)
addQuitClosure(fun4)

prints

ok3
ok4
ok2
ok1

instead of what a user would expect:
ok4
ok3
ok2
ok1

why not instead overload addQuitProc and user can pass a closure or proc with same API, but more importantly order would be preserved (reverse order)?

@Araq
Copy link
Member

Araq commented May 13, 2020

Well, it's a start....

@juancarlospaco
Copy link
Collaborator Author

Thanks, awesome. 🙂

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

3 participants