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

don't introduce 'dispose', use '=dispose', fixes #17003 [backport:1.4] #17062

Merged
merged 1 commit into from
Feb 16, 2021

Conversation

Araq
Copy link
Member

@Araq Araq commented Feb 16, 2021

No description provided.

@Araq Araq merged commit e463a67 into devel Feb 16, 2021
@Araq Araq deleted the araq-fixes-17003 branch February 16, 2021 23:07
@timotheecour
Copy link
Member

timotheecour commented Feb 16, 2021

  • what about these:
compiler/liftdestructors.nim:744:48:  #var disposeCall = genBuiltin(c.g, mDispose, "dispose", x)
doc/destructors.rst:626:6:      dispose(x)
lib/pure/asyncdispatch.nim:370:15:        system.dispose(customOverlapped.data.cell)
lib/pure/asyncdispatch.nim:381:17:          system.dispose(customOverlapped.data.cell)
lib/system/arc.nim:167:6:#proc dispose*(x: pointer) = nimRawDispose(x)
lib/system/gc_common.nim:96:5:proc dispose*(x: ForeignCell) =
lib/system/mmdisp.nim:110:7:  proc dispose*(x: ForeignCell) = discard
lib/system/orc.nim:102:30:      cstderr.rawWrite "lacks dispose"
lib/system/orc.nim:108:28:      cstderr.rawWrite "has dispose!\n"

(some of which are just in comments/msgs but still)

  • I think there should be a "type bound routine" section in manual mentioning that routines (not operators) starting with = (eg: =destroy) are type bound, ie (in my understanding) are attached to a type, regardless of whether they're in import scope.
  AttachedOpToStr*: array[TTypeAttachedOp, string] = [
    "=destroy", "=copy", "=sink", "=trace", "=dispose", "=deepcopy"]

there is already https://nim-lang.github.io/Nim/destructors.html#lifetimeminustracking-hooks but it's incomplete, and less searcheable / not very clear.

(see also proposed =default in nim-lang/RFCs#290)

EDIT: for the 2nd point => #17063

narimiran pushed a commit that referenced this pull request Feb 17, 2021
ardek66 pushed a commit to ardek66/Nim that referenced this pull request Mar 26, 2021
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.

2 participants