[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: referencing table elements within the same table constructor
- From: steve donovan <steve.j.donovan@...>
- Date: Thu, 10 Jun 2010 14:28:08 +0200
On Wed, Jun 9, 2010 at 2:56 PM, Warlich, Christof
<christof.warlich@thermofisher.com> wrote:
> interface = {
..
> incoming = {
> SET = function()
> print(interface["port"]) -- error!!
What you can do here is ensure that these functions are always passed
the interface table, that is, make that function function(interface)
and call it so interface.incoming.SET(interface). This allows for a
straightforward OOP style.
steve d.