Elektrine lite

← Feed

@typeswitch@gamedev.lgbt

Post #1933089

2026-05-03 23:27 UTC

"C doesn't have iterators--" https://godbolt.org/z/8348j44fv

Replies (8)

  • @typeswitch@gamedev.lgbt 2026-05-03 23:42

    "C doesn't have iterators-- (Part 2)" https://godbolt.org/z/nWM1x8roz

    Open ##1933088

  • @typeswitch this is kinda fire tho,,, Sometimes I wish I had access to C macros in Lua (without 3rd party support of course).

    Open ##1981495

  • @cinnamon@mk.absturztau.be 2026-05-04 00:20

    @typeswitch@gamedev.lgbt "C doesn't have Coroutines" (Spoiler: It has, but you (generic you) aren't ready for the horrors of their implementation) https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html

    Open ##1981539

  • @mc@mathstodon.xyz 2026-05-04 06:01

    @typeswitch based

    Open ##1981543

  • @SRAZKVT@tech.lgbt 2026-05-04 06:17

    @typeswitch those aren't things i'd use because they hurt readability, you'd need to check definition (usually will be out of view, perhaps even on another file) of macro and how it applies in your code but yes you can make horrors with the preprocessor

    Open ##1981544

  • @typeswitch i'm not even mad

    Open ##1981545

  • @tfb@functional.cafe 2026-05-04 08:14

    @typeswitch revises my opinion I guess C shouldn't have iterators 😹

    Open ##1981546

  • @Fiona@blahaj.zone 2026-05-04 08:41

    @typeswitch@gamedev.lgbt Edit: Scratch that. They did officially add it in C23, in a pointlessly incompatible way with C++... Why? I am quite certain that typeof is an unstandardized extension, so no, this doesn't work in C. That said, pointers are definitionally iterators according to C++'s definition if the term, so it's less an issue of not having them, than of lacking the language support to make their use nice.

    Open ##1981547