rethinkdb / rethinkdb/docs

Writing RethinkDB Drivers has incorrect AST example for `r.do`

Open
#1,180 4 comments 0 reactions 1 assignee View on GitHub

@chipotle is already working on this.

Since Sep 14, 2016.

bug
Dominant language
CSS
Stars
118
Forks
161
PR merge metrics
No merged PRs in 30d

Description

The docs currently show:

[FUNCALL,
  [FUNC,
    [[MAKE_ARRAY, [1, 2]],
      [ADD,
        [[VAR, [1]],
         [VAR, [2]]]]]],
  10,
  20]

// FUNCALL = 64, FUNC = 69, MAKE_ARRAY = 2, ADD = 24, VAR = 10

[64, [69, [[2, [1, 2]], [24, [[10, [1]], [10, [2]]]]]], 10, 20]

I believe it is incorrect and should instead read:

[FUNCALL,
  [[FUNC,
    [[MAKE_ARRAY, [1, 2]],
      [ADD,
        [[VAR, [1]],
         [VAR, [2]]]]]],
  10,
  20]
]

// FUNCALL = 64, FUNC = 69, MAKE_ARRAY = 2, ADD = 24, VAR = 10

[64, [[69, [[2, [1, 2]], [24, [[10, [1]], [10, [2]]]]]], 10, 20]]

There is a missing [ before FUNC and at the end there is a missing ]. I think it may be valid REQL to have both of these brackets emitted but it's confusing when the node.js driver does emit these.

Contributor guide

Open the contributing guide

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.