I can see how that makes sense under most circumstances, though my current use case is making me question whether that always make sense.
In my case, I want to use some of the existing types and functions in std.os.windows, but there are WinAPI functions I'd like to use that aren't included in the standard library namespaces.
I could use two separate constants eg.
const w = std.os.windows;
const w_extra = @import("windefs.zig") // Additional API fns/types
But technically, they should be just one namespace, they both contain WinAPI definitions.
So what I have to do currently, is re-export the stuff I need from std.os.windows in my windefs.zig file just so I can have everything under a single namespace, which is kind of annoying eg.
// windefs.zig
const w = std.os.windows;
pub const WINAPI = w.WINAPI;
pub extern "kernel32" fn AllocConsole() callconv(WINAPI) win32.BOOL;
// main.zig
const w = @import("windefs.zig");
fn thing() callconv(w.WINAPI) void {
_ = w.AllocConsole();
}
Maybe I'm just thinking about the problem wrong idk.