unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Clinton Ebadi <clinton@unknownlamer.org>
To: hanwen@xs4all.nl
Cc: guile-devel@gnu.org
Subject: Re: Internal visibility
Date: Wed, 11 Jun 2008 03:24:15 -0400	[thread overview]
Message-ID: <87k5gw4eow.fsf@unknownlamer.org> (raw)
In-Reply-To: <g2nj0t$rrl$1@ger.gmane.org> (Han-Wen Nienhuys's message of "Wed\, 11 Jun 2008 01\:05\:52 -0300")

Han-Wen Nienhuys <hanwen@xs4all.nl> writes:

> Ludovic Courtès escreveu:
>>>> Guile's string API is aiming not to be 8-bit-assuming, and I would
>>>> guess from the code above that the C++ string class is 8-bit-assuming.
>>> Sorry, I guess I don't understand. What _is_the assumption for
>>> representing strings in GUILE?
>> 
>> Strings in Guile will eventually be sequences of Unicode code points (as
>> opposed to "bytes"), which can be represented in a variety of different
>> ways (UTF-8, UCS-4, etc.).  How Guile represents strings and whether
>> this representation "changes dynamically" (as you suggested) should not
>> be exposed to the applications in order to leave as much freedom as
>> possible to Guile's implementation strategy.
>
> I think that a sequence of Unicode code points this is a somewhat
> limited view of how strings should be used.  Among others, the
> implication is that programs cannot rely on being able to index a
> string in O(1) time (since the string might be UTF-x encoded).
>
> What do I use if I want to have guaranteed O(1) indexing -that is- if
> I want to manipulate strings of bytes?  
>
> How would I read the contents of a binary file without jumping through 
> encoding hoops?

Uniform byte vectors. If you're using C you can just read everything
into a normal C array and then use
scm_take_u8_vector()/scm_u8vector_elements().

-- 
thehurdguy: LOL you'll end up being like that urban myth
thehurdguy: the guy that thinks he's orange juice
thehurdguy: I'll be like "dude, I know a lisp programmer who did
            so much acid, he thinks he's an empty list..."




  parent reply	other threads:[~2008-06-11  7:24 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-07 23:46 [PATCH] Fix continuation problems on IA64 Neil Jerram
2008-05-08 20:09 ` Ludovic Courtès
2008-05-08 21:29   ` Neil Jerram
2008-05-09  8:15     ` Ludovic Courtès
2008-05-09 22:19       ` Neil Jerram
2008-05-11  3:06         ` Ludovic Courtès
2008-05-12 21:02           ` Neil Jerram
2008-05-14  3:45             ` Internal visibility Ludovic Courtès
2008-05-27 21:32               ` Ludovic Courtès
2008-05-31 21:23                 ` Ludovic Courtès
2008-06-01  8:00                   ` Neil Jerram
2008-06-01 11:05                     ` Ludovic Courtès
2008-06-01 20:48                       ` Neil Jerram
2008-06-01 22:02                         ` Ludovic Courtès
2008-06-01 20:24                   ` Han-Wen Nienhuys
2008-06-09 18:10                     ` Neil Jerram
2008-06-10  1:51                       ` Han-Wen Nienhuys
2008-06-10  7:37                         ` Ludovic Courtès
2008-06-10  8:04                           ` Thien-Thi Nguyen
2008-06-10 12:09                             ` Ludovic Courtès
2008-06-11  7:49                               ` Thien-Thi Nguyen
2008-06-11 12:20                                 ` Ludovic Courtès
2008-06-12 20:45                                   ` Mike Gran
2008-06-23 12:20                                     ` Ludovic Courtès
2008-06-11  4:05                           ` Han-Wen Nienhuys
2008-06-11  7:18                             ` Ludovic Courtès
2008-06-11  7:24                             ` Clinton Ebadi [this message]
2008-06-11  7:39                               ` Ludovic Courtès
2008-06-11 16:09                               ` Han-Wen Nienhuys
2008-06-23 12:18                                 ` Ludovic Courtès
2008-06-11  7:37                             ` Neil Jerram
2008-05-12 22:18     ` [PATCH] Fix continuation problems on IA64 Neil Jerram
2008-05-14  2:55       ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k5gw4eow.fsf@unknownlamer.org \
    --to=clinton@unknownlamer.org \
    --cc=guile-devel@gnu.org \
    --cc=hanwen@xs4all.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).