lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Exactly. The idea is to shield clients as much as possible from knowing how
the object is implemented.

Mark

on 9/22/04 12:13 PM, Rici Lake at lua@ricilake.net wrote:

> Well, that was my first reaction, too. But when I started to think
> about it, particularly when playing around with implementing objects as
> coroutines, I realised that it is nice to be able to do:
> 
>  obj:method(arg1, arg2)
> 
> without having to know whether obj is a traditional table-based object,
> or a function-based object. (In other words, the implementation of obj
> could change without having to change consumers of the object.) Of
> course, you could write a wrapper for obj to make it work properly, but
> Mark's idea seems like a nice way of getting around having to do that.