guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: string-map arg order


From: Alex Shinn
Subject: Re: string-map arg order
Date: 06 Sep 2001 14:34:06 -0400
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.0.104

>>>>> "Dirk" == Dirk Herrmann <address@hidden> writes:

    Dirk> No, you have to re-calculate the character position in every
    Dirk> iteration

Do you?  I was originally thinking in the context of multi-threading -
it seems preferable that a procedure like string-for-each work on an
static version of the string so you don't have to worry about
synchronization issues with other threads.  But here without threads
you're mutating the object that you're looping over inside a loop.  Is
this something that has to be defined?

If so, then the string contents object won't work with fixed-width
representations either.  An external C function will only be looking
at the char*, not using our accessors macros, and therefore wouldn't
pick up changes in the string from other threads.  Whether we have to
re-allocate to make room for wider utf8 chars, or re-allocate to
upgrade from 1 to 2 or 4 byte chars makes no difference to an external
library.

-- 
Alex Shinn <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]