I have a verse file utils.verse that I want to declare a stack to be use in all my verse scripts.
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath }
using { /Verse.org/Random }
stack<public>(t:type) := class<computes>:
Items<public>:[]t = array{}
Push<public>(Item:t)<computes>:stack(t)=
stack(t){ Items := Items + array{Item} }
Pop<public>()<decides><computes>:tuple(stack(t), t)=
Ret:t = Items[Items.Length - 1]
(stack(t){ Items := Items.RemoveElement[Items.Length - 1] }, Ret)
isEmpty<public>():logic=
if(Items.Length = 0):
return true
false
But I keep having an error declaration in VCStudio with: stack(t:type) := class
(t:type) Can't access a function from a preceding type.(3502)