[racket] clarification for beginners please
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>