about summary refs log tree commit diff
path: root/pkg/lang/vm/value/value.go
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2022-05-20 00:01:11 +0200
committerMel <einebeere@gmail.com>2022-05-20 00:01:11 +0200
commitfe93d5c015e8e2c883d2c1e74f2e5ce071256cb5 (patch)
tree2d153d41fb5799828c8e8ebd8dc1158ddac9e9ac /pkg/lang/vm/value/value.go
parentbfa32b8b880b42eda6007ba81f8fbbd340009322 (diff)
downloadjinx-fe93d5c015e8e2c883d2c1e74f2e5ce071256cb5.tar.zst
jinx-fe93d5c015e8e2c883d2c1e74f2e5ce071256cb5.zip
Access methods for VM data and stop Array copying
Diffstat (limited to 'pkg/lang/vm/value/value.go')
-rw-r--r--pkg/lang/vm/value/value.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/lang/vm/value/value.go b/pkg/lang/vm/value/value.go
index e932ed3..daa17dd 100644
--- a/pkg/lang/vm/value/value.go
+++ b/pkg/lang/vm/value/value.go
@@ -2,7 +2,7 @@ package value
 
 type Value struct {
 	t Type
-	d any
+	d Data
 }
 
 func NewInt(x int64) Value {
@@ -27,7 +27,7 @@ func NewBool(b bool) Value {
 
 func NewArray(arr []Value) Value {
 	t := Type{Kind: ArrayType}
-	return Value{t: t, d: ArrayData(arr)}
+	return Value{t: t, d: ArrayData{arr: &arr}}
 }
 
 func NewNull() Value {
@@ -47,6 +47,6 @@ func (v Value) Type() Type {
 	return v.t
 }
 
-func (v Value) Data() any {
+func (v Value) Data() Data {
 	return v.d
 }