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.

____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to