Polymorphic Variables
Q. What is a polymorphic variable?
A. It’s a variable that can hold values of more than one type.
In Scheme, symbols often serve as polymorphic variables:
(define x 5)
(set! x ’apple)
(set! x ’(peaches and pears))
Previous slide
Next slide
Back to first slide
View graphic version