This is what works:
(define obj1 (maak-object (coord 1 1) #f #f #t))
(set! karaktersenobjectenlijst (append karaktersenobjectenlijst
(list (list 'object obj1)))))
> (cadar karaktersenobjectenlijst)
obj1
> (positie obj1)
{1 . 1}
This doesn't work:
> (positie (cadar karaktersenobjectenlijst))
. . vector-ref: expects type <vector> as 1st argument,
. . given: obj1; other arguments were: 0
How can I make it use the value obj1
when (cadar karaktersobjectenlijst)
is evaluated?
The code is correct. I have replaced your functions with some dummys and it evaluates fine:
The problem must be in your library code or the way you use it. The Scheme evaluation works fine.