More hacking on luaengine:

why not just directly get the item?

If I create this function (it's horribly inefficient but proof of concept:) I can just go ahead and get an item directly from a string:
Code
      emu["getitem"] = [this](const char* itemname){ 	sol::table table = sol().create_table();
					// 10000 is enough?
					int index = -1;
					save_item return_item;
					if (!(itemname == 0))					
					for(int i = 0; i < 10000; i++)
					{
						std::string name;
						const char *item;
						unsigned int size, count;
						void *base;
						item = machine().save().indexed_item(i, base, size, count);
						if(!item) break;
						//name = &(strchr(item, '/')[1]);
						name = item;
						table[name] = i;
                                                if (itemname == name) index = i;						
					}
				if (index == -1 || !machine().save().indexed_item(index, return_item.base, return_item.size, return_item.count))	
					{	return_item.base = nullptr;
						return_item.size = 0;
						return_item.count= 0;
					};
					return return_item;
				};


Code
[MAME]> print(emu.item(emu.items()["Apple //e/:/0/m_y_calibration"]):readasdouble(0))
1.3e-05
[MAME]> print(emu.getitem("Apple //e/:/0/m_y_calibration"):readasdouble(0))
1.3e-05
[MAME]> print(emu.getitem("Apple //e/:/0/m_x_calibration"):readasdouble(0))
1.2e-05
[MAME]> print(emu.getitem("Apple misspelled"):readasdouble(0))
nil
[MAME]> print(emu.getitem("doesnt exist"):readasdouble(0))
nil
[MAME]> print(emu.getitem():readasdouble(0))
nil