Fix #27: Documentation, First example for class:clone() lists wrong output

This commit is contained in:
Matthias Richter 2013-11-24 13:00:07 +01:00
parent e5c9bfbac7
commit 92db001b10
2 changed files with 8 additions and 2 deletions

View File

@ -2087,7 +2087,10 @@ Create a clone/deep copy of the class.
print(a.x, a.y) --> prints '10 10' print(a.x, a.y) --> prints '10 10'
b = point:clone() b = point:clone()
print(b.x, b.y) --> prints '10 10' print(b.x, b.y) --> prints '0 0'
c = a:clone()
print(c.x, c.y) --> prints '10 10'
#### Example: #### Example:

View File

@ -1453,7 +1453,10 @@ a.x, a.y = 10, 10
print(a.x, a.y) --> prints '10 10' print(a.x, a.y) --> prints '10 10'
b = point:clone() b = point:clone()
print(b.x, b.y) --> prints '10 10' print(b.x, b.y) --> prints '0 0'
c = a:clone()
print(c.x, c.y) --> prints '10 10'
</code></pre> </code></pre>
<pre><code class="lua">-- using Class.clone() to copy tables <pre><code class="lua">-- using Class.clone() to copy tables
Class = require 'hump.class' Class = require 'hump.class'