Compare commits

..

No commits in common. "f5fd24fb765df938816063acf2190cfe8f049b26" and "813df95e020b56369785b965b0de49c1d06b5740" have entirely different histories.

4 changed files with 11 additions and 10 deletions

2
.vscode/launch.json vendored
View File

@ -27,7 +27,7 @@
"arguments": "main.zig",
"cwd": "${workspaceRoot}",
"valuesFormatting": "parseText",
"preLaunchTask": "Build Tests",
"preLaunchTask": "Build Test",
},
]
}

View File

@ -5,7 +5,7 @@
pub const io = @import("./io.zig");
///
/// Metaprogramming introspection and generation utilities.
/// Metaprogramming introspection utilities
///
pub const meta = @import("./meta.zig");

View File

@ -12,12 +12,13 @@ pub fn FnReturn(comptime Fn: type) type {
}
///
/// Returns a single-input single-output closure type where `In` represents the input type, `Out`
/// represents the output type, and `captures_size` represents the size of the closure context.
/// Returns a single-input single-output closure type where `Input` represents the input type,
/// `Output` represents the output type, and `captures_size` represents the size of the closure
/// context.
///
pub fn Function(comptime captures_size: usize, comptime In: type, comptime Out: type) type {
pub fn Function(comptime captures_size: usize, comptime Input: type, comptime Output: type) type {
return struct {
applyErased: fn (*anyopaque, In) Out,
applyErased: fn (*anyopaque, Input) Output,
context: [captures_size]u8,
///
@ -28,7 +29,7 @@ pub fn Function(comptime captures_size: usize, comptime In: type, comptime Out:
///
/// Applies `input` to `self`, producing a result according to the current context data.
///
pub fn apply(self: *Self, input: In) Out {
pub fn apply(self: *Self, input: Input) Output {
return self.applyErased(&self.context, input);
}
@ -38,7 +39,7 @@ pub fn Function(comptime captures_size: usize, comptime In: type, comptime Out:
///
/// The newly created [Self] is returned.
///
pub fn capture(captures: anytype, comptime call: fn (@TypeOf(captures), In) Out) Self {
pub fn capture(captures: anytype, comptime call: fn (@TypeOf(captures), Input) Output) Self {
const Captures = @TypeOf(captures);
if (@sizeOf(Captures) > captures_size)
@ -51,7 +52,7 @@ pub fn Function(comptime captures_size: usize, comptime In: type, comptime Out:
.context = undefined,
.applyErased = struct {
fn do(erased: *anyopaque, input: In) Out {
fn do(erased: *anyopaque, input: Input) Output {
return call(@ptrCast(*Captures, @alignCast(
captures_align, erased)).*, input);
}

View File

@ -1,5 +1,5 @@
test {
_ = @import("./core/main.zig");
_ = @import("./engine/main.zig");
_ = @import("./oar/main.zig");
_ = @import("./ona/main.zig");
}