Thread overview
[Issue 5309] Add language support for external D symbols refs
Nov 01, 2015
Infiltrator
May 22, 2018
Dmitry Olshansky
Jul 08, 2021
Dlang Bot
Dec 17, 2022
Iain Buclaw
November 01, 2015
https://issues.dlang.org/show_bug.cgi?id=5309

Infiltrator <lt.infiltrator@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lt.infiltrator@gmail.com

--- Comment #1 from Infiltrator <lt.infiltrator@gmail.com> ---
Perhaps I'm misunderstanding what you're after, but isn't this what import does?

=======
module m1;

import m2 : var, doSomething;

void main() {
   var.doSomething();
}
=======
module m2;

int var;

void doSomething(int a) { }
=======

--
May 22, 2018
https://issues.dlang.org/show_bug.cgi?id=5309

Dmitry Olshansky <dmitry.olsh@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dmitry.olsh@gmail.com

--- Comment #2 from Dmitry Olshansky <dmitry.olsh@gmail.com> ---
I believe I've seen a general mechanism for that such as __ident("any string " ~ "expressions") that would also work beautifully.

--
July 08, 2021
https://issues.dlang.org/show_bug.cgi?id=5309

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #3 from Dlang Bot <dlang-bot@dlang.rocks> ---
@Geod24 created dlang/dmd pull request #12839 "Fix 5309 - Support `extern(D)` symbol refs" fixing this issue:

- Fix 5309 - Support `extern(D)` symbol refs

  Currently, `extern(D)` is quite incomplete: An `extern(D)` symbol is mangled
  as if it was in the module it is declared in, while users usually want to
  declare a function or type that lives in another module.

  Borrowing from the syntax that was adopted for `extern(C++, name.space)`, we
introduce `extern(D, pkg.mod)`.
  Note that, unlike `extern(C++)`, no string alternative is needed:
  the motivation for the string variant was that C++ namespaces could be D
keywords,
  hence some namespaces could not be bound with the identifier variant,
  a problem which obviously does not apply to `extern(D)` symbols.

  The need for this functionality is easily demonstrated by druntime's
`externDFunc`.
  `core.internal.traits : externDFunc` is a template that defines an
`extern(D)` symbol in another module.
  This is currently done by using `pragma(mangle)` along with `core.demangle :
mangleFunc`.

  And as it turns out, the only reason for `core.demangle : mangleFunc` to
exists is for `externDFunc`.
  Hence, implementing this functionality will greatly simplify a core piece of
druntime:
  `core.demangle : mangle` (and its derivatives, including `mangleFunc` and
`externDFunc`) can be removed
  and replaced by `XXX.mangleof`, relying on the compiler instead of a library
function which have to be
  kept in sync with the compiler implementation.

https://github.com/dlang/dmd/pull/12839

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=5309

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P4

--