Skip to content

Commit

Permalink
Fix type in "Methods and Initializers".
Browse files Browse the repository at this point in the history
  • Loading branch information
munificent committed Jul 26, 2021
1 parent a2d3a9e commit c31698b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion book/methods-and-initializers.md
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ When the VM executes the call to `Brunch()`, it goes like this:

Any arguments passed to the class when we called it are still sitting on the
stack above the instance. The new CallFrame for the `init()` method shares that
stack window, so those arguments implictly get forwarded to the initializer.
stack window, so those arguments implicitly get forwarded to the initializer.

Lox doesn't require a class to define an initializer. If omitted, the runtime
simply returns the new uninitialized instance. However, if there is no `init()`
Expand Down
6 changes: 6 additions & 0 deletions note/log.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2021/07/26 - responsive index page
2021/07/25 - index page photos
2021/07/24 - work on index page
2021/07/23 - work on index page, change cover colors
2021/07/22 - work on index page
2021/07/21 - work on index page
2021/07/20 - work on kindle version
2021/07/19 - work on kindle version
2021/07/18 - ebook covers, proof in calibre, kindle export
Expand Down
2 changes: 1 addition & 1 deletion site/methods-and-initializers.html
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@ <h3><a href="#invoking-initializers" id="invoking-initializers"><small>28&#8202;
<p>When the VM executes the call to <code>Brunch()</code>, it goes like this:</p><img src="image/methods-and-initializers/init-call-frame.png" alt="The aligned stack windows for the Brunch() call and the corresponding init() method it forwards to." />
<p>Any arguments passed to the class when we called it are still sitting on the
stack above the instance. The new CallFrame for the <code>init()</code> method shares that
stack window, so those arguments implictly get forwarded to the initializer.</p>
stack window, so those arguments implicitly get forwarded to the initializer.</p>
<p>Lox doesn&rsquo;t require a class to define an initializer. If omitted, the runtime
simply returns the new uninitialized instance. However, if there is no <code>init()</code>
method, then it doesn&rsquo;t make any sense to pass arguments to the class when
Expand Down

0 comments on commit c31698b

Please sign in to comment.