mirror of
https://github.com/vrld/hump.git
synced 2024-11-23 12:24:19 +00:00
Fix #27: Documentation, First example for class:clone() lists wrong output
This commit is contained in:
parent
e5c9bfbac7
commit
92db001b10
@ -2087,7 +2087,10 @@ Create a clone/deep copy of the class.
|
||||
print(a.x, a.y) --> prints '10 10'
|
||||
|
||||
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:
|
||||
|
||||
|
@ -1453,7 +1453,10 @@ a.x, a.y = 10, 10
|
||||
print(a.x, a.y) --> prints '10 10'
|
||||
|
||||
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>
|
||||
<pre><code class="lua">-- using Class.clone() to copy tables
|
||||
Class = require 'hump.class'
|
||||
|
Loading…
Reference in New Issue
Block a user