Is there an equivalent to defstruct in Lisp for Mathematica? [duplicate]

I guess I am used to using data structures in most languages, the closest function for Mathematica would be similar to the defstruct macro in Lisp... is there such a thing?

• What does defstruct do? Mar 21 '17 at 16:54
• It creates a set of function to access list elements, say you have a structure named aStruct with elements {arg1, arg2, arg3). defstruct defines functions that access these elements directly Mar 21 '17 at 17:14
• The macro function defineAccessors from (13722) is like a lightweight version of defstruct. Mar 21 '17 at 19:43
• @guymadison For the need you describe, what is the gain over an Association, which effectively comes with accessors? (Type checking could be handled by a constructor, if that's the issue.)
– Alan
Mar 22 '17 at 2:41