[racket] clarification for beginners please

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Thu Apr 25 22:15:04 EDT 2013

Alan Johnsey wrote at 04/25/2013 10:04 PM:
> (define x (make-posn 4 5))
>
> (define y (make-posn 4 5))
>
[...]
>
> > (equal? x y)
>
> #f
>
[...]
>
> Adding #:transparent to the posn struct definition makes x equal? to 
> both y and z as it should, and eq? gives #f when comparing x and y as 
> it should.
>

Seems good for security that one can't use "equal?" and constructor 
brute-force to determine the contents of an opaque struct.

Neil V.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130425/0d119008/attachment.html>

Posted on the users mailing list.