• 3 Posts
  • 6 Comments
Joined 2 years ago
cake
Cake day: June 28th, 2023

help-circle
  • The Idea is that the enum acts as a union, capable of holding any of the member types, It’s not that different from using identifiers and when transpiling to rust I will probably only support variants beginning with string literals (or maybe generate them).

    The main reason is that I could use type inference to define the variants in a returned anonymous enum.

    I like the pipe symbol because it is useful for distinguishing between enums and structs without keywords. And I just personally think it looks better. And allow for pretty anonymous enums like (|String |Int) for something that can accept both a string and an integer.




  • Thanks!

    I intend for the language to have a similar borrow checker and type system. Which is why I’m targeting rust. It means I have something to check against when writing the tooling. (Although I’m not sure I’ll get that far. My computer is littered with dead projects).