Skip to content

Add documentation and make Std.C.from_string Fail when the string contains \0 - #294

Merged
jfecher merged 9 commits into
jfecher:masterfrom
FlameyosSnowy:master
Dec 2, 2026
Merged

jfecher merged 9 commits into
jfecher:masterfrom
FlameyosSnowy:master

Conversation

@FlameyosSnowy

Copy link
Copy Markdown
Contributor

Added documentation to read_file_bytes, read_file, gcd, lcm, Arc and Mutex.

Std.C.from_string now fails when the string contains \0 and has a new effect which is Fail (all usages in the standard library Fail anyway so not that bad(?) of a breaking change)

FlameyosSnowy added 2 commits December 2, 2026 17:10
(Could use some more examples like in `Mutex` but it's at least a lot
better XD)
@FlameyosSnowy

Copy link
Copy Markdown
Contributor Author

The tests were not passing, but then I ran the tests on a fresh clone of Ante and those are the tests that are failing. The code I wrote didn't affect the results of any fails

@jfecher jfecher left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for the doc help and the examples!

Can you just edit from_string with the one suggestion I added there? Then this should be all set.

Comment thread stdlib/src/Sync/Mutex.an Resolved
Comment thread stdlib/src/Sync/Mutex.an Resolved
Comment thread stdlib/src/Sync/Mutex.an Resolved
Comment thread stdlib/src/C.an Resolved
Comment thread stdlib/src/IO.an Resolved
Comment thread stdlib/src/Math.an Resolved
Comment thread stdlib/src/Math.an Resolved
Comment thread stdlib/src/Math.an Resolved
@FlameyosSnowy
FlameyosSnowy requested a review from jfecher December 2, 2026 16:10
jfecher
jfecher previously approved these changes Dec 2, 2026
Comment thread stdlib/src/C.an Resolved
Comment thread stdlib/src/C.an Resolved
Comment thread stdlib/src/C.an Resolved
@jfecher
jfecher merged commit 7bb6e90 into jfecher:master Dec 2, 2026
jfecher added a commit that referenced this pull request Dec 2, 2026
…ontains \0 (#294)

* Fix: from_string now crashes on any additional \0 that has been added

* Add some documentation.

(Could use some more examples like in `Mutex` but it's at least a lot
better XD)

* More precise statement

* Apply batched suggestions from code review

Co-authored-by: jfecher <jfecher11@gmail.com>

* FIX: `from_string`'s String can now hold a \0 if it's at the very end

* Update stdlib/src/C.an

* Update stdlib/src/C.an

* Update stdlib/src/C.an

---------

Co-authored-by: FlameyosSnowy <flamesflowsnow@gmail.com>
Co-authored-by: jfecher <jfecher11@gmail.com>
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.

2 participants