Add to_str method for Bool, List, Dict, and universal types#8786
Closed
codegod100 wants to merge 1 commit intoroc-lang:mainfrom
Closed
Add to_str method for Bool, List, Dict, and universal types#8786codegod100 wants to merge 1 commit intoroc-lang:mainfrom
codegod100 wants to merge 1 commit intoroc-lang:mainfrom
Conversation
FabHof
reviewed
Dec 29, 2025
| List.fold(list, Item.default(), |acc, elem| acc + elem) | ||
| } | ||
|
|
||
| to_str : List(U8) -> Try(Str, [BadUtf8({ index: U64, problem: Str.Utf8Problem }), ..others]) |
Collaborator
There was a problem hiding this comment.
I think List.to_str should be List(a) -> Str where { a.to_str() -> Str }. Utf8 to string should be in Str.
Collaborator
|
@codegod100 I think we should raise a topic in |
- Add Bool.to_str method - Add List.to_str method with interpreter support - Add Dict.to_str method with interpreter support - Add universal to_str method for all types via Check.zig and ModuleEnv
a76ee75 to
d82ab41
Compare
Collaborator
|
I don't think these builtin methods are planned -- we have |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
to_strmethods for converting values to string representation.Changes
Bool.to_strmethodList.to_strmethod with interpreter supportDict.to_strmethod with interpreter supportto_strmethod for all types via Check.zig and ModuleEnvTesting
test/snapshots/to_str_methods.md