Documentation
¶
Index ¶
- func AsBool(v any) bool
- func AsFloat(v any) (float64, bool)
- func AsFloatArg(args []any, i int) (float64, bool)
- func AsInt(v any) (int, bool)
- func AsIntArg(args []any, i int) (int, bool)
- func AsStringArg(args []any, i int) string
- func CanBeInt(f float64) bool
- func ToString(v any) string
- func ToStringWithEnv(v any, env *common.Env) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsFloat ¶
AsFloat converts a value to float64 if possible. Returns the float value and a boolean indicating success.
func AsStringArg ¶
func CanBeInt ¶ added in v1.1.3
CanBeInt checks if a float64 value can be represented as an integer without loss of precision Returns true if the float is a whole number (e.g., 3.0, -5.0, 0.0)
func ToString ¶
ToString converts a value to its string representation. This handles all Polyloft types including primitive wrappers, class instances, etc. For better environment handling, use ToStringWithEnv when an environment is available.
func ToStringWithEnv ¶ added in v1.1.10
ToStringWithEnv converts a value to its string representation with proper environment handling. When env is provided, it's used as the parent for method calls on class instances. This ensures builtin classes are accessible when toString methods are called.
Types ¶
This section is empty.