lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hello Andrew,

Andrew Starks <andrew@starksfam.org>:
> One use case might be to have an optimized time symbol that is tied to a PTP clock. Maybe this would be faster than using a required library and that could be significant in applications that make decisions based on that clock?

Possibly. Like I said, everyone's use case is different, Lua being an
embedded language.

> If that is not a correct example, can you correct that or give another example of a use case where this might be useful?

Grep any codebase with generic code for type checks, and you get the
reasoning behind the example I gave: `(type(a)=="number") and the
likes of it. More complex checks could involve a value being table or
a userdata with metatable. For other ideas, see e.g.
https://github.com/Roblox/luau/blob/61766a692c53cae3ea47408fb0c38f9b1af786d8/Common/include/Luau/Bytecode.h#L396
.

Best regards,

--
DoubleF