<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Op 6-4-2012 15:23, Stephen Bloch schreef:
<blockquote
cite="mid:E969CA67-B5C3-4783-AC35-3650A6DB035B@adelphi.edu"
type="cite"><br>
<div>
<div>On Apr 6, 2012, at 3:39 AM, Roelof Wobben wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<div bgcolor="#FFFFFF" text="#000000">
<table class="RktBlk" style="position: static; z-index:
auto; " cellspacing="0">
<tbody>
<tr>
<td><span class="RktCmt">;</span><span class="RktCmt"> </span><span
class="RktCmt">interp. </span><span class="RktPn">(</span><span
class="RktSym">make-editor</span><span class="stt">
</span><span class="RktSym">s</span><span
class="stt"> </span><span class="RktSym">t</span><span
class="RktPn">)</span><span class="RktCmt"> means
the text in the editor is</span></td>
</tr>
<tr>
<td><span class="RktCmt">;</span><span class="RktCmt"> </span><span
class="RktPn">(</span><span class="RktSym"><a
moz-do-not-send="true"
href="http://docs.racket-lang.org/htdp-langs/beginner.html#%28def._%28lib._htdp-beginner..rkt._lang%29._%28%28lib._lang%2Fhtdp-beginner..rkt%29._string-append%29%29"
class="RktValLink" pltdoc="x">string-append</a></span><span
class="stt"> </span><span class="RktSym">s</span><span
class="stt"> </span><span class="RktSym">t</span><span
class="RktPn">)</span><span class="RktCmt"> with
the cursor displayed between </span><span
class="RktSym">s</span><span class="RktCmt"> and </span><span
class="RktSym">t</span></td>
</tr>
</tbody>
</table>
<br>
<br>
So for aaaaaaa| s has the value of aaaaa en t has the value
of ""<br>
</div>
</blockquote>
<div><br>
</div>
No, s should be "aaaaaaa" and t should be "".</div>
<div><br>
</div>
<div>
<blockquote type="cite">
<div bgcolor="#FFFFFF" text="#000000"> For aaaa|aaaa s I
think s has the value of aaaaa and t has the value of aaa<br>
</div>
</blockquote>
<div><br>
</div>
No, s should be "aaaa" and t should be "aaaa". The cursor is
supposed to be displayed between s and t.</div>
<div><br>
<blockquote type="cite">
<div bgcolor="#FFFFFF" text="#000000">If I use the length of
the first string and I press one time on the left-key then
the new-length could be the old-one - 1. Then I could use
substring to cut that part away.<br>
</div>
</blockquote>
<div><br>
</div>
Sure. Note that you'll need to not only make the new s shorter
than the old s, but also make the new t longer than the old t.
And vice versa when somebody presses on the right-arrow key.</div>
<div><br>
<blockquote type="cite">
<div bgcolor="#FFFFFF" text="#000000"> The t part I could say
if it's empty substring ( s , (string-lenght s), 1) and if
it's not empty use a string-append.</div>
</blockquote>
<div><br>
</div>
You could, but that's unnecessarily complicated. string-append
works regardless of whether s or t is empty.</div>
<div><br>
</div>
<br>
<div>
<span class="Apple-style-span" style="border-collapse: separate;
color: rgb(0, 0, 0); font-family: Helvetica; font-size:
medium; font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: normal; orphans:
2; text-align: auto; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
-webkit-border-horizontal-spacing: 0px;
-webkit-border-vertical-spacing: 0px;
-webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width:
0px; "><span class="Apple-style-span" style="border-collapse:
separate; color: rgb(0, 0, 0); font-family: Helvetica;
font-size: medium; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
-webkit-border-horizontal-spacing: 0px;
-webkit-border-vertical-spacing: 0px;
-webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width:
0px; ">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space;
-webkit-line-break: after-white-space; ">
<div>Stephen Bloch</div>
<div><a moz-do-not-send="true"
href="mailto:sbloch@adelphi.edu">sbloch@adelphi.edu</a></div>
</div>
</span></span>
</div>
<br>
</blockquote>
<br>
Thanks,<br>
<br>
I now know I have a idea which could work.<br>
<br>
Roelof<br>
</body>
</html>