Drakuo
Drakuo

Reputation: 11

What metamethod is print()?

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.

Upvotes: 1

Views: 138

Answers (1)

lhf
lhf

Reputation: 72392

No metamethod calls print.

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

Upvotes: 3

Related Questions