[plt-scheme] Using student-defined structures in a teachpack
I'd like to have a teachpack which allows the student to define her own
Point struct such that the functions in the teachpack work with the
student-defined Point. For example,
Teachpack:
(module a mzscheme
(provide point->pair)
(define (point->pair a-point)
(cons (point-x a-point) (point-y a-point))))
Definitions window (with the above teachpack loaded):
(define-struct point [x y])
(point->pair (make-point 1 2))
Any tips on how such a teachpack could be written?
--
Mike Burns mike at mike-burns.com http://mike-burns.com