I want to abstract the following functions:
(define (road_length1 n)
(road-length (node-road1 n)))
(define (road_length2 n)
(road-length (node-road2 n)))
(define (road_length3 n)
(road-length (node-road3 n)))
My structures for a node and road are like this:
(define-struct node [Letter road1 road2 road3])
(define-struct road [name length])
Hence I want to be able to access the length of a given road from a node, like this:
(define (road_length n road_number)
(road-length (node-(road_number) n)))
However this doesn't work
road-length, notroad_length.