func SliceGet(slice *Slice, index int) lisp.Object {
	return aref(slice.data, slice.offset+index)
}
SliceGet extract slice value using specified index.
package rt
import (
	"emacs/lisp"
)
type Slice struct {
	data   lisp.Object
	offset int
	len    int
	cap    int
}
func SliceLen(slice *Slice) int { return slice.len }
func SliceCap(slice *Slice) int { return slice.cap }
func MakeSlice(length int, zv lisp.Object) *Slice {
	return &Slice{
		data: lisp.Call("make-vector", length, zv),
		len:  length,
		cap:  length,
	}
}
func MakeSliceCap(length, capacity int, zv lisp.Object) *Slice {
	if length == capacity {
		return MakeSlice(length, zv)
	}
	data := lisp.Call("make-vector", capacity, lisp.Intern("nil"))
	for i := 0; i < length; i++ {
		lisp.Aset(data, i, zv)
	}
	return &Slice{data: data, len: length, cap: capacity}
}
func ArrayToSlice(data lisp.Object) *Slice {
	length := lisp.Length(data)
	return &Slice{data: data, len: length, cap: length}
}