How would I go about extracting the number of members inside a structure for a cond.
For example. I have two different structures, one with two members and another with three. How would I extract the number of members in my structures in this case?
(define-struct triangle (vertex1 vertex2 vertex3)) (define-struct rectangle (vertex1 vertex2))
(define (shape=? shape1 shape2) ...)
Where shape1 can be a triangle or rectangle.
I may be approaching the question wrong, but I need shape=? to produce true if shape1 and shape2 are both triangles or both rectangles, and false otherwise.
Thank you.
Your problem description pretty much describes what's required: