Stream: compiler development

Topic: should roc_std::RocDec support Default/Ord?


view this post on Zulip Sven van Caem (Oct 14 2024 at 11:28):

Current Rust glue seems to assume that RocDec implements Default, PartialOrd, and Ord, but these aren't implemented in the roc_std. Since it's a fixed-point type, it should be trivially totally orderable, and Default should probably just return 0 like all the other number types. Is there a reason these shouldn't be implemented or is this an oversight?

view this post on Zulip Richard Feldman (Oct 14 2024 at 11:32):

oversight I think!

view this post on Zulip Richard Feldman (Oct 14 2024 at 11:32):

feel free to add them :smiley:

view this post on Zulip Sven van Caem (Oct 14 2024 at 11:32):

Gotcha! I'll make a pull request.

view this post on Zulip Sven van Caem (Oct 14 2024 at 12:59):

#7166 :)


Last updated: Jul 06 2025 at 12:14 UTC