proxies

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package proxies provides proxy for all GX values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Array

type Array struct {
	// contains filtered or unexported fields
}

Array is the proxy for an atomic or an array value.

func NewArray

func NewArray(typ ir.Type, shape *shape.Shape) (*Array, error)

NewArray returns a new proxy array.

func (*Array) Shape

func (pr *Array) Shape() *shape.Shape

Shape of the value.

func (*Array) Type

func (pr *Array) Type() ir.Type

type NamedType

type NamedType struct {
	// contains filtered or unexported fields
}

NamedType is the proxy for a named type.

func (*NamedType) NamedType

func (pr *NamedType) NamedType() *ir.NamedType

NamedType returns the IR named type.

func (*NamedType) Type

func (pr *NamedType) Type() ir.Type

func (*NamedType) Under

func (pr *NamedType) Under() Value

Under returns the underlying value.

type Slice

type Slice struct {
	// contains filtered or unexported fields
}

Slice is the proxy for a slice value.

func (*Slice) Element

func (pr *Slice) Element(i int) (Value, error)

Element return the ith element of the proxy value.

func (*Slice) Size

func (pr *Slice) Size() int

Size returns the number of element in the slice.

func (*Slice) SliceType

func (pr *Slice) SliceType() *ir.SliceType

SliceType returns the type of the slice.

func (*Slice) Type

func (pr *Slice) Type() ir.Type

type Struct

type Struct struct {
	// contains filtered or unexported fields
}

Struct is the proxy for a structure value.

func (*Struct) Field

func (pr *Struct) Field(name string) Value

Field returns the value of a field.

func (*Struct) StructType

func (pr *Struct) StructType() *ir.StructType

StructType returns the structure type of the value.

func (*Struct) Type

func (pr *Struct) Type() ir.Type

type Value

type Value interface {

	// Type returns the GX type of the value.
	Type() ir.Type
	// contains filtered or unexported methods
}

Value is a value for which we know the type but not the value yet.

func ToProxies

func ToProxies(vals []values.Value, typs []*ir.Field) ([]Value, error)

ToProxies converts GX values to proxy values keeping only the type of the value.

func ToProxy

func ToProxy(val values.Value, typ ir.Type) (Value, error)

ToProxy returns the proxy value of a given value.

Jump to

Keyboard shortcuts

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