1

I am making a custom lua enviroment in c++ using metamethods. I am confused of what metamethod would call print()? I think it is __call but I am not quite sure.

Drakuo
  • 11
  • 1
  • 1
    Possible duplicate of [How do we change the way print displays a table](https://stackoverflow.com/questions/29639479/how-do-we-change-the-way-print-displays-a-table) – Henri Menke Dec 16 '17 at 02:30
  • 1
    you may call print from any metamethod. please explain what you want to achieve as your question doesn't make too much sense as is. – Piglet Dec 16 '17 at 09:43

1 Answers1

3

No metamethod calls print.

On the other hand, print calls tostring, which respects the __tostring metamethod.

lhf
  • 70,581
  • 9
  • 108
  • 149