reasonml / reasonml/reason

Better syntax for ## and #=

Open
#849 8 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

RFC
Dominant language
OCaml
Stars
10.3k
Forks
438
PR merge metrics
No merged PRs in 30d

Description

cc @bobzhang

Currently, for BuckleScript (and hopefully jsoo) we have foo##bar for dot access, and foo##bar #= 1 for object field assignment.

The feedback we've gotten is that people are scared of "hash hash" ¯_(ツ)_/¯

So we can special-case hash hash and hash equal to something else in Reason. Proposal:

  1. foo..bar .= baz
  2. foo->bar <- baz
  3. foo."bar" = baz

Third one might or might not work. #= can be another PR then.

Third one allows names that are otherwise illegal, e.g. foo."BAR-BAZ_QUX"

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. First compare the three proposed syntaxes and confirm which form is intended for Reason, then trace the existing handling of ## and #= and define parsing and assignment coverage before considering the work done.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.