digitalmars.D - Library inheritance
- Felix (6/6) Nov 04 2014 Hi,
- Adam D. Ruppe (2/2) Nov 04 2014 A library may provide header files for this, or you can just use
- Felix (6/8) Nov 05 2014 Okay, but that would mean to have the source available. Though
- David Nadlinger (5/10) Nov 05 2014 You can still use a version of the source code without any of the
- Chris Williams (8/14) Nov 05 2014 You can run the compiler to create library and header (.di)
Hi, just wondering if it's possible, due to the lag of header files, to inherit from some class that exists within a library, that has been written in D? How did you solve that? Thanks in advance.
Nov 04 2014
A library may provide header files for this, or you can just use the source code itself to import and inherit from.
Nov 04 2014
On Tuesday, 4 November 2014 at 15:27:33 UTC, Adam D. Ruppe wrote:A library may provide header files for this, or you can just use the source code itself to import and inherit from.Okay, but that would mean to have the source available. Though for me it seems like D is attempting to get rid of header files. But when dealing with, lets say, some D compiled library there seems to be now way to accomplish something like inheriting as ELF doesn't provide you with the necessary data.
Nov 05 2014
On Wednesday, 5 November 2014 at 23:04:00 UTC, Felix wrote:On Tuesday, 4 November 2014 at 15:27:33 UTC, Adam D. Ruppe wrote:You can still use a version of the source code without any of the function bodies (usually ending in .di). Same as in C++, more or less. DavidA library may provide header files for this, or you can just use the source code itself to import and inherit from.Okay, but that would mean to have the source available.
Nov 05 2014
On Tuesday, 4 November 2014 at 15:03:08 UTC, Felix wrote:Hi, just wondering if it's possible, due to the lag of header files, to inherit from some class that exists within a library, that has been written in D? How did you solve that? Thanks in advance.You can run the compiler to create library and header (.di) files. Anything that requires compile-time execution, like templates, will remain in the .di. Anything that can be compiled as-is, will go in the library and just be represented as a function/method declaration in the .di file. So, basically, the same as C++ except you don't have to manually write your own header files.
Nov 05 2014