I'm reading How to Design Programs.
This question is about the Beginning Student Language.
Doing the exercise of the Graphical Editor, we define an structure like this:
(define-struct editor [pre post])
Which implies the following selectors:
editor-pre
editor-post
So I was attempting to do the exersice 87 where basically we have to repeat the development of the graphical editor.
The new structure is:
(define-struct editor [text cursor])
So we don't have in this case the selectors editor-pre
and editor-post
, so I could create a function called editor-pre
if I want (which is the case ).
But I'm wondering if that is bad practice, making it more difficult future extensions to the editor structure, i.e. I couldn't rewrite it easily like:
(define-struct editor [text cursor pre])
(For whatever reason).