To make a structure type transparent, use the #:transparent keyword after the field-name sequence:
(struct posn (x y)
#:transparent)
> (posn 1 2)
(posn 1 2)
An instance of a transparent structure type prints like a call to the constructor, so that it shows the structures field values. A transparent structure type also allows reflective operations, such as struct? and struct-info, to be used on its instances.
Although a transparent structure type prints in a way that shows its content, the printed form of the structure cannot be used in an expression to get the structure back, unlike the printed form of a number, string, symbol, or list.
A prefab (“previously fabricated”) structure type is a built-in type that is known to the Racket printer and expression reader. Infinitely many such types exist, and they are indexed by name, field count, supertype, and other such details. The printed form of a prefab structure is similar to a vector, but it starts #s instead of just #, and the first element in the printed form is the prefab structure type’s name.
Lastly, I think you may need using #:transparent most of the time over #:prefab ,based on my experience I usually use #:transparent.
#:transparent
struct
s --equal?
. Given(struct x (y))
(equal? (x 1) (x 1))
is#f
! It's only#t
with#:transparent
. – Tetrapody