druntime redesign

Jacob Carlborg doob at me.com
Wed May 6 17:36:35 UTC 2020


On 2020-05-06 14:18, IGotD- wrote:

> I see many occurrences like this insinde the version blocks:
> 
> import core.sys.platform.subfunctionality : subFuncImpl;
> alias functionality = subFuncImpl;
> 
> We could provide with an abstract interface like this as you suggested.
> 
> mixin(import_("core", "sys", platform, "semaphore")) : 
> SemaphoreAcquireImpl;
> The Semaphore class can use SemaphoreAcquireImpl.

It doesn't need to be an abstract interface. Since the implementation 
will be selected at compile time the only thing that is required that 
all implementation implements the same API. The API can be functions, 
structs, classes, whatever. For an existing example see [1].

[1] https://github.com/dlang/druntime/blob/master/src/rt/sections.d

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list