-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Labels
Feature RequestNew feature or requestNew feature or request
Description
Describe the feature
C like languages allow the user to "manipulate" strings using '%' e.g "%s" for strings, "%d" for decimals and so on. Python also has the same feature using .format() and f-strings.
Use Case
andika() currently only supports arbitrary number of arguments but no way of organizing them as per user needs.
Adding this will enable the user to do like:
fanya i = 0
fanya jina = jaza("Unaitwa nani rafiki? ")
wakati (i <= 5) {
andika("Rafiki %s hii ni %d", jina, i)
i++
}
(the same case with f-strings)
Proposed Solution
The golang and or python implementation details can be of use:
- Golang fmt
- Python f-string
- Formatted output (GNU)
- GNU C vprintf (used by printf and family) source code (for reference purposes)
- The Open Group Base Specifications Issue 7, 2018 edition for dprintf, fprintf, printf, snprintf, sprintf
This are previous implementation details, not all the formatting will be copied over.
Other Information
No response
Acknowledgements
- This feature might incur a breaking change
- I may be able to implement this feature request
Version used
v0.5.1 (compiled from source with modifications from #80)
Environment details (OS name and version, etc.)
GO VERSION: go version go1.22.1 linux/amd64
Kernel: 6.8.1-arch1-1
Shell: Bash
OS: Arch Linux x86_64
Metadata
Metadata
Assignees
Labels
Feature RequestNew feature or requestNew feature or request