From 92db001b10548a77a849fe2509984076c4475a3b Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Sun, 24 Nov 2013 13:00:07 +0100 Subject: [PATCH] Fix #27: Documentation, First example for class:clone() lists wrong output --- README.md | 5 ++++- index.html | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f2bd953..b6e232e 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/index.html b/index.html index 2ba5cf4..83bf466 100644 --- a/index.html +++ b/index.html @@ -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'
-- using Class.clone() to copy tables
 Class = require 'hump.class'