Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 397
    • Issues 397
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 13
    • Merge requests 13
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Wiki
  • Concepts
  • Named Tuples

Named Tuples · Changes

Page history
add tutorial about adding a compiler flag authored Apr 07, 2025 by Quinten Cabo's avatar Quinten Cabo
Hide whitespace changes
Inline Side-by-side
concepts/Named-Tuples.md 0 → 100644
View page @ b562eac3
The [named tuples](./Named-Tuples.md) are basically literal linked lists.
If you have a tuple like this:
```
(a,(b,(c)))
```
You can access the first element by just getting it.
You can access the first element by getting the second element and then the first element of that.
And so on.
It is probably not a coincidence that this is how the values of the named tuple are 3 long.
```c
SAC_ND_DECL__DATA( (SACp_pinl_271__emlr_220_i, (SCL, (NHD, (NUQ, (INT, (GLO, (NON, (NOT, (NDI, (INT, )))))))))), int, )
```
These named tuples were introduced to deal with the lack of macros with a variable number of arguments in C.
The idea is that you can just make a macro with a single input and just unwrap the named tuple until you get what you want.
The named tuples are build with the beautiful macros in `src/runtime/essentials_h/tuple.h`
There T_* macros are defined.
Clone repository
  • concepts
    • Deprecated Modules
    • Globals
    • Intermediate Code Macros
    • Named Tuples
    • Overloading
    • Preprocessor
    • Primitive functions
    • Runetime Representations
    • input stdin
    • phm xt
    • ref counting methods
    • type famlies
    • type patterns
  • error messages
    • Anthropomorphic error essages
    • Colored error messages
View All Pages