This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const print = @import("std").debug.print; | |
const Animal = struct { | |
const Self = @This(); | |
speakFn: fn(*const Animal) void, | |
pub fn speak(self: *const Self) void { | |
self.speakFn(self); |