Hacker News new | past | comments | ask | show | jobs | submit login

Dot syntax is used when accessing a function/property on a value, :: is used when accessing a function/property on a module or type. I think it's great having this visual distinction, especially given that you can call the same function in either style:

  let x = Foo::new();

  x.bar();
  Foo::bar(x);



I thought the distinction was meaningful until I worked in a language that used dot pervasively, and saw that it was totally fine.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: