From f40a1c23467eef36f53635e525f8b25f591e8a45 Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Sat, 29 Nov 2025 19:46:34 +0100 Subject: chore: shorter name for packages, simpilfy vm values --- vm/type.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'vm/type.go') 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. -- cgit v1.2.3