Created
October 4, 2014 05:12
-
-
Save legumbre/67bb2583b400bcc08701 to your computer and use it in GitHub Desktop.
prototype lua tostring
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prototype = require 'prototype' | |
person = prototype { default = prototype.assignment_copy, use_prototype_delegation = true } | |
person.__tostring = function (s) return "My name is " .. s.name end | |
cacho = person:clone() | |
cacho.name = "Cacho" | |
print(cacho) | |
pocha = person:clone() | |
pocha.name = "La Pocha" | |
print(pocha) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment