[racket] Implementing an equal? method for a class

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Sun Jul 29 18:07:36 EDT 2012

For 81 slots, I'd actually use a (define b (make-vector 81 0)) instead and use an access polynomial. I am almost certain that it is faster. 




On Jul 29, 2012, at 6:00 PM, Eli Barzilay wrote:

> Yesterday, Gregory Woodhouse wrote:
>>    (define b(make-vector 9 (make-vector 9 0)))
> 
> BTW, this is wrong -- it builds a vector of 9 zeros, then uses that
> same vector 9 times:
> 
>  -> (define x (make-vector 2 (make-vector 2 0)))
>  -> x
>  '#(#(0 0) #(0 0))
>  -> (vector-set! (vector-ref x 0) 0 1)
>  -> x
>  '#(#(1 0) #(1 0))
>  -> (print-graph #t)
>  -> x
>  '#(#0=#(1 0) #0#)
> 
> -- 
>          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
>                    http://barzilay.org/                   Maze is Life!
> ____________________
>  Racket Users list:
>  http://lists.racket-lang.org/users



Posted on the users mailing list.