タグ

関連タグで絞り込む (0)

  • 関連タグはありません

タグの絞り込みを解除

zigに関するmoznionのブックマーク (1)

  • Interfaces in Zig

    const Interface = struct { // can call directly: iface.pickFn(iface) pickFn: fn (*Interface) i32, // allows calling: iface.pick() pub fn pick(iface: *Interface) i32 { return iface.pickFn(iface); } }; We could have gotten away with just the function pointer pickFn, but that would mean the usage code would have to call it iface.pickFn(iface), repeating the interface pointer. Adding pub fn pick makes

    Interfaces in Zig
    moznion
    moznion 2022/08/09
  • 1