jmeaster30 / ocean

A C-like programming language (get it like sea-like like an ocean lol)
GNU General Public License v3.0
0 stars 0 forks source link

Operator overloading #5

Closed jmeaster30 closed 3 years ago

jmeaster30 commented 3 years ago

I like this feature of c++ so I do feel like I would like to have this in ocean.

Ideas: op<+>: (a: i32, b: i32) -> (c: i32) { c = a * b; } Would we want to restrict the types that are being overridden??

Basically just function declaration but the function name is op<OPERATOR>

I probably would imagine we could override '()', '[]', and '.' but I don't know how it would work to implement. That being said, I haven't started that so I can probably just figure it out then and make the feature work in as many situations as possible now

jmeaster30 commented 3 years ago

done :)