# Simple function chaining

**URL:** <https://ziggit.dev/t/simple-function-chaining/14024>\
**Category:** Help\
**Tags:** language\
**Created:** [January 21, 2026, 6:53am UTC](https://ziggit.dev/t/simple-function-chaining/14024 "2026-01-21T06:53:04Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![dee0xeed](https://ziggit.dev/letter_avatar_proxy/v4/letter/d/3ab097/32.png) [@dee0xeed](https://ziggit.dev/u/dee0xeed)\
**Post date:** [January 23, 2026, 5:25pm UTC](https://ziggit.dev/t/simple-function-chaining/14024/17 "2026-01-23T17:25:52Z")

</div>

A couple of years ago there was a topic, just in case.

> [@Methods chaining](https://ziggit.dev/t/methods-chaining/2051):
>
> If some (or all) functions within a struct return a pointer to self, then we can easily chain methods calls, akin using a pipe in a shell: const std = @import("std"); const Object = struct { i : i32 = 0, pub fn inc(self: \*Object) \*Object { self.i += 1; return self; } pub fn add(self: \*Object, n: i32) \*Object { self.i += n; return self; } pub fn sqr(self: \*Object) \*Object { self.i = self.i \* self.i; return self; }…

---

_[View the full topic](https://ziggit.dev/t/simple-function-chaining/14024)._
