#lang scribble/manual @title{struct} Struct has the following form: @verbatim|{ struct: (?) }| @tt[]{struct} provides the ability to define structures. As an example, @verbatim|{ struct: point3d(x,y,z) }| defines two functions, @tt[]{point3d}, and @tt[]{is_point3d}. The function @tt[]{point3d} will take three arguments, which are the values for the three fields @tt[]{x}, @tt[]{y}, and @tt[]{z}. At the BSL level, these values cannot be changed. @verbatim|{ def my_point: point3d(1,2,3) }| The function @tt[]{is_point3d} returns @tt[]{True} if and only if its argument was constructed with @tt[]{point3d}. @verbatim|{ > is_point3d(my_point) True > is_point3d("hello world") False }| To access the fields, use the dot operator. @verbatim|{ > my_point.x 1 > my_point.y 2 }|