Hi, The documentation says that struct creates structures that are treated as first-class values. I can see the motivation for pursuing expressiveness. So what do we achieve using first-class structures? On the down side, I see some problems. For example, in the Beginning Student language, a posn is both a posn? and a struct?.
> (posn? (make-posn 1 2)) #t > (struct? (make-posn 1 2)) #t I guess this is because posn is declared to be #:transparent. In my opinion, exposing the struct? nature of posn undermines abstraction and breaks encapsulation. But without declaring it #:transparent, the printer could not echo informative response. It seems to me the two aspects: exposing the struct?nature and informative result are unnecessarily tangled. If they can be separated, we may be able to give informative result and at the same time not to expose the struct?nature of structure types. Best, Yi
____________________ Racket Users list: http://lists.racket-lang.org/users