<p><br>
On Sep 18, 2011 5:50 AM, "Marco van de Voort" <<a href="mailto:marcov@stack.nl">marcov@stack.nl</a>> wrote:<br>
> <br>
> The trouble is that it is not that easy, consider the first thing a<br>
> long time pascal user will do is fix his existing code which has many<br>
> constructs that loop over a string:<br>
><br>
> setlength(s2,s1);<br>
> for i:=1 to length(s1) do<br>
> s2[i]:=s1[i];<br>
><br>
> Now, to return codepoint[i], you need to parse all codepoints before [i].<br>
><br>
> So instead of O(n) this loop suddenly becomes O(n^2)....</p>
<p>Sure it does. So what? The point is, it will do what the user expects. And for most users, the fact that it does it slowly won't even matter. For those whom it does matter, it is a chance for them to learn the right way. Like I said in my first post, this is an extremely complex subject. I think trying to optimize user code before they even write it adds even more complexity, which slows implementation down. Get something that works and gives the expected results first, worry about speed later. By the time you finish, the CPU speed will have caught up to you.</p>