(I’m js now getting into zig / systems programming in general, so sry for any egregious mistakes lol)
I’m writing a brainfsck-to-zig transpiler, and for the ‘.’ command, I wrote this:
// the buffer is defined above with "var buffer: [3]u8 = @splat(undefined);"
std.Io.File.stdout().writer(init.io, &buffer).initInterface(buffer).print("{d}", .{tape.items[pointer]});
However, upon compiling the output from a hello world bf program, I get this error message:
test.zig:110:50: error: no field or member function named 'initInterface' in 'Io.File.Writer'
std.Io.File.stdout().writer(init.io, &buffer).initInterface(buffer).print("{d}", .{tape.items[pointer]});
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
C:\Users\thebo\AppData\Roaming\VSCodium\User\globalStorage\ziglang.vscode-zig\zig\x86_64-windows-0.17.0-dev.864+3deb86baf\lib\std\Io\File\Writer.zig:1:1: note: struct declared here
const Writer = @This();
^~~~~
C:\Users\thebo\AppData\Roaming\VSCodium\User\globalStorage\ziglang.vscode-zig\zig\x86_64-windows-0.17.0-dev.864+3deb86baf\lib\std\Io\File\Writer.zig:67:5: note: 'initInterface' is not a member function
pub fn initInterface(buffer: []u8) Io.Writer {
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In the zig std docs though, the “initInterface” function is included with std.Io.File.Writer
What’s going on?