← Back to context

Comment by inkyoto

13 days ago

I concur RE: «::». For deep levels of nesting, the level of noise that «::» causes becomes excessive.

When Rust was in its infancy, I maintained a local fork for a while where I modified the parser to use the Ada syntax («'», a single apostrophe) for the same purpose. So

  std::collections::hash_map::HashMap::entry

became

  std'collections'hash_map'HashMap'entry

But I am not convinced that using «.» for two distinct purposes – 1) as a name qualifier, and 2) as a method/data element accessor – is a good idea, for maintaining the semantic clarity is important, i.e. is «e» in «a.b.c.d.e»

  1) A method call; or

  2) An accessor for a deeply nested data structure.

It is not easy to say whilst just glancing upon the code.