reflect

package
v0.0.0-...-2ff796e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2024 License: MPL-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NilR = r.Value{}
	Nil  = xr.MakeValue(NilR)

	NoneR = r.ValueOf(none{}) // used to indicate "no value"
	None  = xr.MakeValue(NoneR)

	TypeOfInt   = r.TypeOf(int(0))
	TypeOfInt8  = r.TypeOf(int8(0))
	TypeOfInt16 = r.TypeOf(int16(0))
	TypeOfInt32 = r.TypeOf(int32(0))
	TypeOfInt64 = r.TypeOf(int64(0))

	TypeOfUint    = r.TypeOf(uint(0))
	TypeOfUint8   = r.TypeOf(uint8(0))
	TypeOfUint16  = r.TypeOf(uint16(0))
	TypeOfUint32  = r.TypeOf(uint32(0))
	TypeOfUint64  = r.TypeOf(uint64(0))
	TypeOfUintptr = r.TypeOf(uintptr(0))

	TypeOfFloat32    = r.TypeOf(float32(0))
	TypeOfFloat64    = r.TypeOf(float64(0))
	TypeOfComplex64  = r.TypeOf(complex64(0))
	TypeOfComplex128 = r.TypeOf(complex128(0))

	TypeOfBool   = r.TypeOf(false)
	TypeOfString = r.TypeOf("")
)

Functions

func Category

func Category(k r.Kind) r.Kind

func ConvertValue

func ConvertValue(v xr.Value, to r.Type) xr.Value

ConvertValue converts a value to type t and returns the converted value. extends reflect.Value.Convert(t) by allowing conversions from/to complex numbers. does not check for overflows or truncation.

func ConvertValueR

func ConvertValueR(v r.Value, to r.Type) r.Value

ConvertValueR converts a value to type t and returns the converted value. extends reflect.Value.Convert(t) by allowing conversions from/to complex numbers. does not check for overflows or truncation.

func IsCategory

func IsCategory(k r.Kind, categories ...r.Kind) bool

func IsNillableKind

func IsNillableKind(k r.Kind) bool

func IsOptimizedKind

func IsOptimizedKind(k r.Kind) bool

IsOptimizedKind returns true if fast interpreter expects optimized expressions for given Kind

func KindToType

func KindToType(k r.Kind) r.Type

func PackTypes

func PackTypes(typ0 xr.Type, types []xr.Type) []xr.Type

func PackValues

func PackValues(val0 xr.Value, values []xr.Value) []xr.Value

func PackValuesR

func PackValuesR(val0 r.Value, values []r.Value) []r.Value

func UnpackValues

func UnpackValues(vals []r.Value) (r.Value, []r.Value)

func ValueInterface

func ValueInterface(v xr.Value) interface{}

ValueInterface() is a zero-value-safe version of xreflect.Value.Interface()

func ValueInterfaceR

func ValueInterfaceR(v r.Value) interface{}

ValueInterfaceR() is a zero-value-safe version of reflect.Value.Interface()

func ValueType

func ValueType(value xr.Value) r.Type

ValueType() is a zero-value-safe version of xreflect.Value.Type()

func ValueTypeR

func ValueTypeR(value r.Value) r.Type

ValueTypeR() is a zero-value-safe version of reflect.Value.Type()

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL