3 ms·
> I guess in lisp you could more easily write a function that maps the previous representation into the new one. Lisp provides a simple way redefine classes. T
by malisper 12y ago
> I guess in lisp you could more easily write a function that maps the previous representation into the new one.
Lisp provides a simple way redefine classes. There is a generic function (basically a function that is extensible), update-instance-for-redefined-class[0], which is called on instances of the old representation to map them to the new one. All a programmer has to do is extend it with the behavior they want. Coincidentally, the link I gave shows how to do this to change the representation of a point from Cartesian coordinates to polar coordinates.
[0] http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/stagenfun_upd_efined-class.html http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec...