So, a few months ago I was playing with lua syntax, probably thinking how it could be redone to write faster, such as “function” being “fn”, etc.
However, I noticed something weird?
For some strange reason, you can write functions with these <> symbols, with text inside, no spaces and regular characters.
function what<a,b,c,i_dont_know>(d,e,f)
print(a,b,c) --> nil nil nil
print(d,e,f) --> 1 2 3
end
what(1,2,3)
Here, in the website’s syntax it looks red, In roblox studio, it doesnt look red and instead is just all white.
Thing’s like these don’t work for any reason.
what<a>(1,2,3) -- > Incomplete statement: expected assignment or a function call
whata(1,2,3) -- > attempt to call a nil value
It seemed liked a cool feature if it was used like a variating character of a function so you could call the same functions with variating letters for different functionality, such as:
whata(1,2,3) -- > Calls the function with a and can achieve different functionality
whati_dont_know(1,2,3) -- > Same thing, different functionality
-- And for the function
function what<a,b,c,i_dont_know>(d,e,f)
in statement do
in <a> do
print("hi")
or <b> do
print("well")
else do
print("oh, i guess you didnt decide which letter.")
end
end
It doesn’t make much sense to me of why it wouldn’t throw a syntax error or anything. Even looked thru Lua or Luau documentation and I wasn’t able to find much about it. Why does it work and why is it there?
If anyone knows, it would be nice to know and use the feature if it’s even a feature.