Skip to content

Commit

Permalink
mention why labels from define_combinator are important
Browse files Browse the repository at this point in the history
  • Loading branch information
jolmg committed Sep 25, 2020
1 parent f20f345 commit e01450d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ between(lit("<"), lit(">"), lit("foo")).label
#=> 'between(lit("<"), lit(">"), lit("foo"))'
```

Having labels that resemble the source code is helpful for [the error
messages](#expectationfailed).

If we use `def` instead of `define_combinator`, then the label would be
that of its definition. In the following case, it would be that assigned by
`<`.
Expand Down

0 comments on commit e01450d

Please sign in to comment.