Skip to content

Feat/string interpolation#17

Merged
Vaishnav-Sabari-Girish merged 2 commits into
mainfrom
feat/string_interpolation
Mar 21, 2026
Merged

Feat/string interpolation#17
Vaishnav-Sabari-Girish merged 2 commits into
mainfrom
feat/string_interpolation

Conversation

@Vaishnav-Sabari-Girish
Copy link
Copy Markdown
Contributor

No description provided.

- Introduced `ns_any_t` tagged union in `ns_print.h` to safely pass mixed C types across the FFI boundary.
- Implemented argument-counting macros (`NS_GET_MACRO`) to seamlessly overload `ns_print` and `ns_println` for up to 8 formatted arguments.
- Used `static inline` constructors to bypass strict C11 `_Generic` type-checking and silence C99 nested designator warnings.
- Built a Rust formatting engine (`format_any`) that safely parses `{}` and extracts values from the union, utilizing `ManuallyDrop` to prevent unintended memory drops of `ns_string`.
- Added `14_string_interpolation.c` example to demonstrate the new functionality.
- Updated README.md and ROADMAP.md.

Signed-off-by: Vaishnav Sabari Girish <vaishnav.sabari.girish@gmail.com>
Signed-off-by: Vaishnav Sabari Girish <vaishnav.sabari.girish@gmail.com>
@Vaishnav-Sabari-Girish Vaishnav-Sabari-Girish merged commit b05520b into main Mar 21, 2026
5 checks passed
@Vaishnav-Sabari-Girish Vaishnav-Sabari-Girish deleted the feat/string_interpolation branch March 21, 2026 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant