asoffer / Icarus

An experimental general-purpose programming language
Apache License 2.0
9 stars 2 forks source link

Separate out copy vs. move assignment syntactically. #20

Closed asoffer closed 3 years ago

asoffer commented 3 years ago

Currently code-generation for most AST nodes supports both copy and move assignments, however, structs only have one assign keyword to which an assignment is bound. The signature is (*T, *T) -> (), (where the first argument is the destination and the second is the source). This means that we either need to find a way to make the signatures different or we need to separate out copy/move assignment via keyword.

Two of many options:

  1. move_assign and copy_assign keywords.
  2. Use (*T, T) -> () as the signature for moves.

I don't currently have strong opinions on this.

Once we make a decision, there are some type-checking and code-generation changes needed.