I want to declare an entry inside the class as follows:
class player (x, y)= object(self) type gun = {x:int; y:int; active:bool} val guns = Array.create 5 {x=0; y=0; active=false} ....
but the compiler claims that this line is a syntax error: type gun = {x: in ....
if declared outside of a class such as
type : gun = {x:int; y:int; active:bool} class player (x, y)= object(self) val guns = Array.create 5 {x=0; y=0; active=false} ....
error: unbound gun.
so that anyone knows how to achieve the same functionality in a different way? thanks!
********* resolved ***
Bizare now works when a type is declared outside, thanks
source share