Re: [racket] struct change question.

2012-04-14 Thread Stephen Bloch
On Apr 14, 2012, at 5:16 AM, Roelof Wobben wrote: > So I thought I could use something like this : > > ; Editor(e) Keyevent (k) -> Editor > ; Change the Editor according to the keyevent > (define (edit e k) > (cond > [ (key=? k "left") (string-append (editor-pre e) (substring (editor-post e)

[racket] struct change question.

2012-04-14 Thread Roelof Wobben
Hello, I have this struct : (define-struct editor (pre post)) ; Editor = (make-editor String String) ; interp. (make-editor s t) means the text in the editor is ; (string-append s t) with the cursor displayed between s and t ; make-editor String String -> Editor ; editor-pre Editor -> String ; e