Herly Quijano
Newcomer
- Joined
- Mar 19, 2021
- Messages
- 79
- Reaction score
- 10
Hello, I'm new here and I starting to learn about Lua, something I wanna ask is a thing that is used in another programing language called text macro, that replicates a code with small difference any time, basically it works like this:
Is the same as:
Is there something similar in Lua or there is a way to replicate it, because I searched and I didn't find anything.
Code:
textmacro EXAMPLE("func1","X")
textmacro EXAMPLE("func2","Y")
runtextmacro EXAMPLE(FUNC_NAME,VAR_TYPE)
function $FUNC_NAME$(var)
SetCoord$VAR_TYPE$(var)
end
endtextmacro
Code:
function func1(var)
SetCoordX(var)
end
function func2(var)
SetCoordY(var)
end
Is there something similar in Lua or there is a way to replicate it, because I searched and I didn't find anything.