summaryrefslogtreecommitdiff
path: root/vm/type.go
diff options
context:
space:
mode:
authorMarc Vertes <mvertes@free.fr>2025-11-29 19:46:34 +0100
committerMarc Vertes <mvertes@free.fr>2025-11-29 19:46:34 +0100
commitf40a1c23467eef36f53635e525f8b25f591e8a45 (patch)
treebeae2442ecee1d734b9a676f7b176376a1d80af5 /vm/type.go
parentfbc73922e9853d7e344e388f3fdfedb8fa323682 (diff)
chore: shorter name for packages, simpilfy vm values
Diffstat (limited to 'vm/type.go')
-rw-r--r--vm/type.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/vm/type.go b/vm/type.go
index 7c33cd2..5f91eee 100644
--- a/vm/type.go
+++ b/vm/type.go
@@ -33,8 +33,8 @@ func (t *Type) Out(i int) *Type {
// Value is the representation of a runtime value.
type Value struct {
- Type *Type
- Data reflect.Value
+ *Type
+ reflect.Value
}
// NewValue returns an addressable zero value for the specified type.
@@ -42,7 +42,7 @@ func NewValue(typ *Type) Value {
if typ.Rtype.Kind() == reflect.Func {
typ = TypeOf(0) // Function value is its index in the code segment.
}
- return Value{Type: typ, Data: reflect.New(typ.Rtype).Elem()}
+ return Value{Type: typ, Value: reflect.New(typ.Rtype).Elem()}
}
// TypeOf returns the runtime type of v.
@@ -53,7 +53,7 @@ func TypeOf(v any) *Type {
// ValueOf returns the runtime value of v.
func ValueOf(v any) Value {
- return Value{Data: reflect.ValueOf(v)}
+ return Value{Value: reflect.ValueOf(v)}
}
// PointerTo returns the pointer type with element t.