From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Clinton Ebadi Newsgroups: gmane.lisp.guile.devel Subject: Re: Internal visibility Date: Wed, 11 Jun 2008 03:24:15 -0400 Message-ID: <87k5gw4eow.fsf@unknownlamer.org> References: <87k5i5d6ei.fsf@ossau.uklinux.net> <87lk2jhp0h.fsf@gnu.org> <87skwrce8y.fsf@ossau.uklinux.net> <87iqxledzz.fsf@gnu.org> <87lk2futg0.fsf@ossau.uklinux.net> <87fxslr1jr.fsf_-_@gnu.org> <878wxv5t7q.fsf@gnu.org> <87mym6dv6t.fsf@gnu.org> <49dd78620806091110v7a667787mef392fbf4446139d@mail.gmail.com> <87iqwhn3jw.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1213169301 24510 80.91.229.12 (11 Jun 2008 07:28:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Jun 2008 07:28:21 +0000 (UTC) Cc: guile-devel@gnu.org To: hanwen@xs4all.nl Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Jun 11 09:29:04 2008 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K6KlF-0001Pw-2R for guile-devel@m.gmane.org; Wed, 11 Jun 2008 09:28:49 +0200 Original-Received: from localhost ([127.0.0.1]:60207 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K6KkR-0001Vk-HC for guile-devel@m.gmane.org; Wed, 11 Jun 2008 03:27:59 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K6KhM-0007YJ-8k for guile-devel@gnu.org; Wed, 11 Jun 2008 03:24:48 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K6KhJ-0007XT-FH for guile-devel@gnu.org; Wed, 11 Jun 2008 03:24:46 -0400 Original-Received: from [199.232.76.173] (port=42021 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K6KhI-0007XI-TM for guile-devel@gnu.org; Wed, 11 Jun 2008 03:24:45 -0400 Original-Received: from deleuze.hcoop.net ([69.90.123.67]:37562) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K6KhI-0006AF-JA for guile-devel@gnu.org; Wed, 11 Jun 2008 03:24:44 -0400 Original-Received: from [71.65.238.103] (helo=localhost.localdomain) by deleuze.hcoop.net with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1K6Kh6-0007Tz-DE; Wed, 11 Jun 2008 03:24:32 -0400 In-Reply-To: (Han-Wen Nienhuys's message of "Wed\, 11 Jun 2008 01\:05\:52 -0300") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 1) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:7318 Archived-At: Han-Wen Nienhuys writes: > Ludovic Court=C3=A8s 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? >>=20 >> 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?=20=20 > > How would I read the contents of a binary file without jumping through=20 > 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(). --=20 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..."