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

[WIP, TODO] turn some include => import in system.nim #13161

Closed
wants to merge 2 commits into from

Conversation

timotheecour
Copy link
Member

@timotheecour timotheecour commented Jan 15, 2020

what changed:

  • turned to import:
    system/arithmetics
    system/exceptions
    system/setops
    system/iterators_1
    system/arithmetics

  • new import:
    system/privatedefs

  • kept as include:
    system/comparisons

same could be done for remaining includes in future PR's

note

I had to keep the following include's:

  • system/basic_types
    because of: Error: system module needs: int
  • system/gc_interface
    because they define public procs but no implementation
    maybe this could be dealt with using importc/exportc ; but should be in future PR's
  • system/memalloc
    ditto

note

# in system/excpt.nim:
{.push experimental: "allowPrivateImport".}
import system/exceptions {.privateImport.} # => gives access to private fields Exception.trace etc just inside this module
  • likewise, it'd allow to make system/comparisons an import, right now it'd fail for ./bin/nim c --newruntime -d:useMalloc --listfullpaths tests/destructor/tnewruntime_strutils.nim because NimSeqV2.p is private
    (plus some mysterious change of stacktrace, see ./bin/nim c -r testament/testament --nim:bin/nim r tests/enum/tenummix.nim, which I don't understand)

@timotheecour timotheecour changed the title turn some include => import in system.nim [WIP] turn some include => import in system.nim Jan 15, 2020
@Araq
Copy link
Member

Araq commented Jan 16, 2020

Sorry, I know it's WIP, but I really don't like it. In practice include is much easier for me to understand, esp when things go wrong inside the compiler.

@narimiran
Copy link
Member

Sorry, I know it's WIP, but I really don't like it. In practice include is much easier for me to understand, esp when things go wrong inside the compiler.

This should be the reason enough to close/reject this. Let us focus on more important stuff.

@narimiran narimiran closed this Jan 23, 2020
@timotheecour timotheecour changed the title [WIP] turn some include => import in system.nim [WIP, TODO] turn some include => import in system.nim Jan 23, 2020
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

Successfully merging this pull request may close these issues.

3 participants