On Mon, Apr 09, 2007 at 11:47:57PM -0400, John Cowan wrote:
> William D Clinger scripsit:
>
> > Quibble: I think the historical view of strings should be
> > continued for backwards compatibility with Scheme tradition.
>
> In that case, you also have to make characters something other than
> Unicode scalar values, or else go to very tricky implementations.
> I'm trying to break as little of R5.92RS as possible.
Not at all. A UCS-4 array will work just fine. It'll just take four
times as much memory (and cache misses / paging / whatever), and four
times as long to copy in bulk (as by string-append, or internally by an
allocator), than would be ideally preferred for 8-bit-able text.
This would hardly be the only part of Scheme amenable to both a
straightforward inefficient implementation and a variety of more
elaborate optimizations.
--
(let ((C call-with-current-continuation)) (apply (lambda (x y) (x y)) (map
((lambda (r) ((C C) (lambda (s) (r (lambda l (apply (s s) l)))))) (lambda
(f) (lambda (l) (if (null? l) C (lambda (k) (display (car l)) ((f (cdr l))
(C k))))))) '((#\J #\d #\D #\v #\s) (#\e #\space #\a #\i #\newline)))))
Received on Wed Apr 11 2007 - 20:15:57 UTC