Weirdness in passing tables

I’ve got figurative bruises from banging my head against my keyboard on this one…

In one module I pass a table (dashboardSheetData) to two other modules as part of their constructors:

local clockClass = require("clock")  
local bonusClass = require("bonus")  
...  
clock = clockClass.new(dashboardSheetData, dashboardImageSheet, storyboard.roomData.time)  
bonus = bonusClass:new(dashboardSheetData, dashboardImageSheet)  

The first (clock) works fine, but I was getting null errors when trying to access data in the table in the other module (bonus).

So, I iterated through the passed table in each of the two other modules (clock & bonus). Here’s what I got in the terminal:
[text]
dashboardSheetData in clock–
getFrameIndex function: 0x1007f2070
getSheet function: 0x102177360
frameIndex table: 0x1021767e0
sheet table: 0x10c5a9960

dashboardSheetData in bonus–
checkForNewBonus function: 0x10c5b1550
new function: 0x10c5b14e0
[/text]

In clock it looks good, but in bonus it’s as if I had passed it itself (i.e. checkForNewBonus & new are functions in bonus). What?!

If it’s helpful, here’s the start of the new function in clock:

function clock.new(dashboardSheetData, dashboardImageSheet, time)  
 print ("dashboardSheetData in clock--") --testing  
 for key,value in pairs(dashboardSheetData) do print(key,value) end --testing  
 print ("") --testing  

And the start of the new function in bonus:

function bonus.new(dashboardSheetData, dashboardImageSheet)  
 print ("dashboardSheetData in bonus--") --testing  
 for key,value in pairs(dashboardSheetData) do print(key,value) end --testing  
 print ("") --testing  

Anyone have ANY idea about what’s going on? I’m stumped.

Conan. [import]uid: 136105 topic_id: 33660 reply_id: 333660[/import]

Ah crap.

I’m really not sure what it is about asking that suddenly makes the solution float to the surface (sigh).

For those who are curious, this has NOTHING to do with the fact that I’m passing a table and EVERYTHING to do with proper syntax.

The call where I pass the table to the bonus constructor is wrong. I have:
[lua]bonus = bonusClass:new(dashboardSheetData, dashboardImageSheet)[/lua]

Where it should be:
[lua]bonus = bonusClass.new(dashboardSheetData, dashboardImageSheet)[/lua]

Period, not colon. [import]uid: 136105 topic_id: 33660 reply_id: 133825[/import]

Ah crap.

I’m really not sure what it is about asking that suddenly makes the solution float to the surface (sigh).

For those who are curious, this has NOTHING to do with the fact that I’m passing a table and EVERYTHING to do with proper syntax.

The call where I pass the table to the bonus constructor is wrong. I have:
[lua]bonus = bonusClass:new(dashboardSheetData, dashboardImageSheet)[/lua]

Where it should be:
[lua]bonus = bonusClass.new(dashboardSheetData, dashboardImageSheet)[/lua]

Period, not colon. [import]uid: 136105 topic_id: 33660 reply_id: 133825[/import]