ZenScript icon indicating copy to clipboard operation
ZenScript copied to clipboard

[Enhancement] typeof

Open yezhiyi9670 opened this issue 5 years ago • 1 comments

ZenScript doesn't require a typename for declaring a variable, but is still very strict with types. However, the documentation sometimes does not describe the types accurately.

I suggest adding a global keyword or global function typeof which return the type of a value as string. This can make debugging much easier.

(Please let me know if there is already one)

yezhiyi9670 avatar Feb 20 '20 12:02 yezhiyi9670

Hey there, and sorry for the late reply ^^'.

I feel like adding another keyword to ZS at this point would carry too much of a risk to break existing scripts. However @TheSilkMiner has created a mod that offers some methods get the type of an object iirc. See this (currently still open) PR for more information: https://github.com/CraftTweaker/CraftTweaker-Documentation/pull/286

kindlich avatar May 26 '20 06:05 kindlich