zetzit / zz

πŸΊπŸ™ ZetZ a zymbolic verifier and tranzpiler to bare metal C
MIT License
1.6k stars 52 forks source link

changing syntax of member functions #154

Open aep opened 3 years ago

aep commented 3 years ago

i'm going to change the syntax of member functions.

they're currently associated by being in the same module, but i think the way golang does it is simpler.

current style:


struct Foo {}

fn foo(Foo *self, int bla) {}

new style:


struct Foo {}

fn(Foo *self) foo (int bla) {}

this might also fix https://github.com/zetzit/zz/issues/123

aep commented 3 years ago

@jwerle objections?

jwerle commented 3 years ago

No objections from me!

aep commented 3 years ago

ah well, not as easy as i thought.

this requires solving the problem that right now absolute names have to be exactly 3 parts long, project::module::type. since you'd nest the functions inside the type, it's project::module::type::type, but abs can't do that.

changing the syntax - without actually allowing multiple functions named the same way in a module - really doesn't add much.

too much work for now.