-
Notifications
You must be signed in to change notification settings - Fork 99
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
Int8/16/32/64 documentation and unit tests #475
Conversation
Co-authored-by: Ryan Vandersmith <[email protected]>
* Text module documentation and examples, first pass * Clarify 'replace()' example * Fix 'translate()' example * Implement suggestions * Replace 'assert' with 'print()' * Update src/Text.mo Co-authored-by: Kento Sugama <[email protected]> * Apply suggestions from code review Co-authored-by: Claudio Russo <[email protected]> * Adjust example formatting * Apply suggestions from code review Co-authored-by: Claudio Russo <[email protected]> Co-authored-by: Kento Sugama <[email protected]> Co-authored-by: Claudio Russo <[email protected]>
* chore: add examples for CertifiedData * chore: add link to example * Apply suggestions from code review Co-authored-by: Kento Sugama <[email protected]> Co-authored-by: Claudio Russo <[email protected]> Co-authored-by: Kento Sugama <[email protected]>
Great stuff - added a few nits - any reason it's still in draft? |
* Add examples to ExperimentalStableMemory * Add 'no-repl' specifiers to examples * Clarify zero-initialization for 'grow()' * 'no-repl' on top-level import example * Update src/ExperimentalStableMemory.mo Co-authored-by: Claudio Russo <[email protected]> * Update src/ExperimentalStableMemory.mo Co-authored-by: Claudio Russo <[email protected]> Co-authored-by: Claudio Russo <[email protected]>
Improve `Float.mo`: * Documentation * Unit tests Issues detected while refactoring: * dfinity/motoko#3646 * dfinity/motoko#3647 Other possible areas of improvements for `Float`: * `isNaN()` function is missing * `equals()` comparison should consider numerical errors, by requiring an epsilon argument. * Positive infinity and negative infinity constants are missing. * `compare` function does not have a total order and is inconsistent, e.g. `compare(NaN, NaN) == #greater`. * `neq` function has a typo. Rename to `neg` The suggestions for improvement are summarized in issue #456
Improve `Deque.mo`: * Documentation * Unit tests Issue detected while refactoring: * #464 Possible improvement for `Deque`: * Reduce runtime and space performance of push/pop functions to `O(1)` worst-case per single function call (by avoiding List-split implementation).
Improve `RBTree.mo`: * Documentation * Unit tests Possible improvements for `RBTree` (#492): * Reduce garbage creation, especially during reading functions, such as `get()` and iteration. * More efficient `size()` function.
Co-authored-by: Claudio Russo <[email protected]>
Co-authored-by: Claudio Russo <[email protected]>
Co-authored-by: Claudio Russo <[email protected]>
Co-authored-by: Claudio Russo <[email protected]>
Thanks for the review. Sorry, I forgot to change the PR status. I changed it now - ready for approval or further improvement. |
Fix some issues reported in #476: * Offer minimum and maximum integer constants * Remove superfluous second argument in `bitnot()`
Oh weird, why are there so many files changed now? Is that because of @ggreif's force-push? Are there fewer diffs if you update the branch with master? |
Indeed, we are back to 8. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! Very thorough indeed!
Improve
Int8.mo
,Int16.mo
,Int32.mo
, andInt64.mo
:Possible improvements for Int8/16/32/64 (#476):
bitnot()
has a superfluous second argument:bitnot(x, y)
should bebitnot(x)
.bitrotLeft
(instead ofbitRotLeft
).bitshiftLeft
usesInt64
butbittest
usesNat
.