Remove overloading #23

Merged
noClaps merged 3 commits from remove-overloading into main 2026-06-03 11:52:02 -04:00
Owner

TODO:

  • Should assert have the message as an argument?
  • Should assert be a keyword?
    int a = 3;
    assert a == 3 { panic("error message"); }
    
  • Should assert be throwing? if so, should it be a builtin at all, or part of std/assert?
  • How should type conversions be handled?
    • Should it be part of the stdlib?
      // std/types/int
      fn from_str(str val) -> int { ... }
      fn from_uint(uint val) -> int { ... }
      
    • Should it be implemented as an interface, like Rust? So would interfaces need to be generic? And would interfaces need to be able to be implemented on base types?
      interface From<T> {
          fn from(T val) -> Self;
      }
      impl From<str> for int {
          fn from(str val) -> Self { ... }
      }
      impl From<uint> for int {
          fn from(uint val) -> Self { ... }
      }
      
TODO: - Should `assert` have the `message` as an argument? - Should `assert` be a keyword? ``` int a = 3; assert a == 3 { panic("error message"); } ``` - Should `assert` be throwing? if so, should it be a builtin at all, or part of `std/assert`? - How should type conversions be handled? - Should it be part of the stdlib? ``` // std/types/int fn from_str(str val) -> int { ... } fn from_uint(uint val) -> int { ... } ``` - Should it be implemented as an interface, like Rust? So would interfaces need to be generic? And would interfaces need to be able to be implemented on base types? ``` interface From<T> { fn from(T val) -> Self; } impl From<str> for int { fn from(str val) -> Self { ... } } impl From<uint> for int { fn from(uint val) -> Self { ... } } ```
noClaps changed title from Remove overloading to WIP: Remove overloading 2026-05-31 05:26:16 -04:00
noClaps force-pushed remove-overloading from 15139b9bbc to 746016ad37 2026-06-03 10:06:27 -04:00 Compare
noClaps changed title from WIP: Remove overloading to Remove overloading 2026-06-03 10:30:19 -04:00
I've left all the instances of `assert` being called in the code for now, I'll migrate that over to `std/assert` once we have the documentation for that ready to go.
noClaps deleted branch remove-overloading 2026-06-03 11:52:02 -04:00
noClaps referenced this pull request from a commit 2026-06-03 11:52:03 -04:00
Sign in to join this conversation.
No reviewers
No labels
stdlib
syntax
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nclang/design!23
No description provided.