Skip to content

Conversation

@P4P5T123
Copy link
Collaborator

adds the following functions enabling context.dot syntax for these functions you can use those instead of the according .fromType() function:

  • Nat.toFloat
  • Text.toNat
  • Text.toInt
  • Nat32.toChar
  • Int.toFloat

@P4P5T123 P4P5T123 requested a review from a team as a code owner October 27, 2025 15:55
@github-actions
Copy link

github-actions bot commented Oct 27, 2025

No description provided.

@crusso
Copy link
Contributor

crusso commented Oct 27, 2025

Thanks but I think it would be better not to continue this PR. Instead @christoph-dfinity and I will figure out how to make similar changes to #412.
It's also not clear whether Text.toNat/toInt should return an option or be called something else instead (maybe Test.asNat/asInt with trapping versions for the non-optional one).

P4P5T123 and others added 2 commits October 28, 2025 10:32
Co-authored-by: Claudio Russo <[email protected]>
Co-authored-by: Claudio Russo <[email protected]>
@P4P5T123
Copy link
Collaborator Author

P4P5T123 commented Oct 28, 2025

Thanks but I think it would be better not to continue this PR. Instead @christoph-dfinity and I will figure out how to make similar changes to #412. It's also not clear whether Text.toNat/toInt should return an option or be called something else instead (maybe Test.asNat/asInt with trapping versions for the non-optional one).

Ok thank you...
IMHO I would avoid introducing a new terminology with .asNat and .asInt as it would further clutter the namespace here.
Then we should probably leave it at the .from funcs there as the underlying idea was to further consistently enable users/LLMs to make contextual dot calls with .toType funcs.

Co-authored-by: Claudio Russo <[email protected]>
@P4P5T123 P4P5T123 closed this Oct 28, 2025
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