rescript-association / reasonml.org

Deprecated in favor of rescript-lang.org
MIT License
125 stars 34 forks source link

Explain the `##` operator (or make the explanation easier to find if it exists) #168

Closed sgrove closed 3 years ago

sgrove commented 4 years ago

As per @jsjoeio in discord:

Follow up question: what is this operator called ##?

yawaramin: that's JavaScript property access @anmonteiro linked to https://bucklescript.github.io/docs/en/object-2#accessors

Ahh! Thank you @yawaramin and thanks for the link @anmonteiro ! I was looking on

ryyppy commented 4 years ago

Just to be clear, the same information is available on reasonml.org: https://reasonml.org/docs/reason-compiler/latest/object-2#accessors

I am not sure how to highlight the ## syntax, except finally finding better names for the Object and Object 2 pages. Any ideas on how to find it more easily are highly appreciated!

jsjoeio commented 4 years ago

A few thoughts that might help:

  1. The search doesn't work on the site. In the idea world, I would search ## and be lead to this page on "Accessors" image
  2. Add a description to "Accessors" - notice how it goes straight to "read" without telling me what it is or why I would use it image
  3. Yes I agree with you, we should find better names than Object and Object 2 😂 There has to be a name that is used to distinguish the two under the hood i.e. in the compiler right? One thought is to consolidate all the information from Object and Object2 into one category called Object
ryyppy commented 3 years ago

Due to the move to ReScript, the ## is obsolete and the Object 2,.. section got refactored into a unified object section.