func (v Val) IsEnum() bool {
	switch v.Type {
	case String, List, Map:
		return true
	default:
		return false
	}
}
IsEnum returns true value is enumerable, returns false if not.
package oop
import (
	"fmt"
	"reflect"
	"unsafe"
	"github.com/fract-lang/fract/pkg/str"
)
const (
	None      uint8 = 0
	Int       uint8 = 1
	Float     uint8 = 2
	String    uint8 = 3
	Bool      uint8 = 4
	Func      uint8 = 5
	List      uint8 = 6
	Map       uint8 = 7
	Package   uint8 = 8
	StructDef uint8 = 9
	StructIns uint8 = 10
	ClassDef  uint8 = 11
	ClassIns  uint8 = 12
	Pointer   uint8 = 13
)
type Val struct {
	Data  interface{}
	Type  uint8
	Mut   bool
	Const bool
	Tag   string
}
func (v Val) Immut() *Val {
	val := &Val{Type: v.Type}
	switch v.Type {
	case Map:
		cpy := MapType{}
		for key, value := range *v.Data.(*MapType) {
			cpy[*key.Get("var")] = *value.Get("var")
		}
		val.Data = &cpy
	case List:
		src := *v.Data.(*ListType)
		cpy := make(ListType, len(src))
		for index, element := range src {
			cpy[index] = *element.Get("var")
		}
		val.Data = &cpy
	default:
		val.Data = v.Data
	}
	return val
}
func (v *Val) Get(valType string) *Val {
	if valType == "ptr" {
		return v
	} else if valType == "mut" {
		return &Val{
			Data:  v.Data,
			Type:  v.Type,
			Mut:   true,
			Const: v.Const,
		}
	}
	if (valType == "" && !v.Mut) || valType == "var" {
		return v.Immut()
	}
	return v
}
func (v Val) String() string {
	switch v.Type {
	case List, Map:
		return fmt.Sprint(*(*interface{})(unsafe.Pointer(&v.Data)))[1:]
	case None:
		return "none"
	}
	return fmt.Sprint(v.Data)
}
func (v Val) Print() bool {
	if v.Data == nil {
		return false
	}
	fmt.Print(v.String())
	return true
}