Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow % formating like in C like languages or fstring like python #81

Open
2 tasks done
gekkowrld opened this issue Mar 21, 2024 · 0 comments · May be fixed by #82
Open
2 tasks done

Allow % formating like in C like languages or fstring like python #81

gekkowrld opened this issue Mar 21, 2024 · 0 comments · May be fixed by #82
Labels
Feature Request New feature or request

Comments

@gekkowrld
Copy link
Contributor

gekkowrld commented Mar 21, 2024

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:

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

@gekkowrld gekkowrld added the Feature Request New feature or request label Mar 21, 2024
@gekkowrld gekkowrld linked a pull request Mar 31, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant