Accessing a list inside struct in Racket

I have a structure as:

(define-struct abc (item-list x y))

I want to access elements of item-list which is a list iteratively. How do I achieve this in racket?

I tried:

(abc-item-list a)

but doesn't work.

Note: I am using Intermediate Student Language for the same.


  • It works for me:

    #lang htdp/isl ;
    (define-struct abc (item-list x y))
    (define test (make-abc (list 1 2) 4 5))
    (abc-item-list test)
    ; ==> (list 1 2)