Permalink
Browse files

fix typos

  • Loading branch information...
lihaoyi committed May 27, 2018
1 parent 6371133 commit 233cc715710fc94be5af56de55c3b174919b01fc
Showing with 5 additions and 5 deletions.
  1. +5 −5 post/32 - Zero-Overhead Tree Processing with the Visitor Pattern.md
@@ -78,7 +78,7 @@ Dict(

## What is the Visitor Pattern

To begin with, let's assume that we have already parsed our Json from it's
To begin with, let's assume that we have already parsed our Json from its
textual input format into the Json data types defined above:

```scala
@@ -129,9 +129,9 @@ The contract of `Visitor` and `DictVisitor` is as follows:
Exactly how "for each JSON {string, number, dictionary}" is implemented, is left
to a separate `dispatch` function.

For now, I am assuming that `Visitor` is generic: it's methods return a type
`T`, representing the "output" of this `Visitor`. `T` will vary depending on
what the concrete Visitor implementation is trying to do:
For now, I am assuming that `Visitor` is generic: its methods return a type `T`,
representing the "output" of this `Visitor`. `T` will vary depending on what the
concrete Visitor implementation is trying to do:

- If it's meant to serialize the Json tree then `T` might be a `String`

@@ -680,7 +680,7 @@ println(dispatchParse(res32, new StringifyVisitor()))
println(dispatchParse(res32, new SummationVisitor()))
// 31340
println(dispatchParse(res32, new RedactVisitor(new ConstructionVisitor())))
println(dispatchParse(res32, new RedactVisitor(new SummationVisitor())))
// 31337
```

0 comments on commit 233cc71

Please sign in to comment.