Re: [TCLCORE] [SPAM] [6.0] Re: base64 in the core?
by Donal K. Fellows other posts by this author
Apr 29 2008 1:51AM messages near this date
Re: [TCLCORE] [SPAM] [6.0] Re: base64 in the core?
|
Re: [TCLCORE] [SPAM] [6.0] Re: base64 in the core?
Larry McVoy wrote:
> On Mon, Apr 28, 2008 at 02:37:03PM +0100, Donal K. Fellows wrote:
> > Kevin Kenny wrote:
> >> Uhm, Donal, excuse me? This is a simple forward iteration. Keep an
> >> index into the string rep - as opposed to the 'string' internal rep.
> >> (That one never shimmers.) On each trip through the loop, decode
> >> one UTF-8 character and advance the index around it. There's no
> >> real slowdown because you don't need to get into quadratic behaviour
> >> counting the UTF-8 characters (the way a naively coded [string index]
> >> loop at Tcl level would).
> >>
> >> If you want to cache single character strings (at least for
> >> ISO8849 characters), go for it. But I suspect that in most uses
> >> of this, the single characters would be short-lived.
> > Bah, this whole discussion is getting out of hand (and I'm highly
> > irritable today because I'm teaching). For the business of [string
> > foreach], I'd be perfectly happy to see an implementation as you
> > describe it. Since it's iterating by single characters, the benefit of
> > buffer sharing would be slight. Whether or not to cache character-objs
> > would be a question to decide at a later date.
>
> Is it possible we're talking past each other?
Very possible. :-)
I've no objections at all to doing a [string foreach], and a mock-up of
it can be scripted (OK, not fast but able to let people test the API)
right now. Then, if we like it, we can write the code to make it go like
greased lightning. (There'd be a need for some new bytecodes to support
it, but that's not a big deal, unlike changing the back-end behaviour of
the string internal representation.)
Donal.
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Tcl-Core mailing list
Tcl-Core@[...].net
https://lists.sourceforge.net/lists/listinfo/tcl-core
Thread:
Trevor Davel
Pat Thoyts
Kevin Kenny
Donal K. Fellows
Larry McVoy
Donal K. Fellows
Larry McVoy
Donal K. Fellows
Kevin Kenny
Donal K. Fellows
Larry McVoy
Donal K. Fellows
Alexandre Ferrieux
Lars Hellstrom
Donal K. Fellows
Alexandre Ferrieux
Donal K. Fellows
Alexandre Ferrieux
Donal K. Fellows
Alexandre Ferrieux
Larry McVoy
|