nim-lang / RFCs

A repository for your Nim proposals.
137 stars 23 forks source link

remove unused `{.exportnims.}` ? what was it for? #375

Open timotheecour opened 3 years ago

timotheecour commented 3 years ago

.exportnims was introduced in a2c040e3bd2a34bff889c22e4fb098b95b45fe53 but seems like it was never used according to git log -i -Sexportnims

commit a2c040e3bd2a34bff889c22e4fb098b95b45fe53
Author: Araq <rumpf_a@web.de>
Date:   Sat Oct 3 23:19:02 2015 +0200

    added undocumented exportNims pragma for Nimscript support

current uses:

compiler/magicsys.nim:122:37:      "symbol conflicts with other .exportNims symbol at: " & g.config$conflict.info)
compiler/pragmas.nim:25:6:    wExportNims, wExtern, wDeprecated, wNodecl, wError, wUsed}
compiler/pragmas.nim:38:18:    wDelegator, wExportNims, wUsed, wPragma}
compiler/pragmas.nim:70:42:    wRequiresInit, wNoalias, wAlign} - {wExportNims, wNodecl} # why exclude these?
compiler/pragmas.nim:1182:11:      of wExportNims:
compiler/wordrecg.nim:45:6:    wExportNims = "exportnims",
Araq commented 3 years ago

It was supposed to be used instead of the currently existing proc foo = discard "overwritten in the VM"; registerCallback("pkg.module.foo", fooImpl) pattern. It can be removed -- or finished and enforced.

juancarlospaco commented 3 years ago

YAGNI ?. :thinking: