I'm working on an implementation of Conway's Game of Life as a way to learn Scheme, and I'm having trouble with the updater. I keep getting the message "The object () is not applicable" when I try to use the following. I could be missing something simple, and any advice on my code is appreciated:
;;bitset and bitclear are just bit-string-set! and bit-string-clear! renamed
(define (update graph u d)
(define (upgraph lst)
(if (null? lst) lst
(begin
(bitset graph (car lst))
(upgraph graph cdr lst)
)
)
)
(define (downgraph lst)
(if (null? lst) lst
(begin
(bitclear graph (car lst))
(downgraph graph (cdr lst))
)
)
)
(upgraph u)
(downgraph d)
)
Thanks,
Cory