From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: David Kastrup Newsgroups: gmane.lisp.guile.user Subject: Re: String internals sketch Date: Wed, 15 Mar 2017 16:46:36 +0100 Organization: Organization?!? Message-ID: <87pohiczkz.fsf@fencepost.gnu.org> References: <87efy52lnp.fsf@fencepost.gnu.org> <87wpbxru68.fsf@pobox.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1489592864 18407 195.159.176.226 (15 Mar 2017 15:47:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 15 Mar 2017 15:47:44 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Mar 15 16:47:39 2017 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1coB9G-0003x9-DF for guile-user@m.gmane.org; Wed, 15 Mar 2017 16:47:38 +0100 Original-Received: from localhost ([::1]:38081 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1coB9K-00057D-M9 for guile-user@m.gmane.org; Wed, 15 Mar 2017 11:47:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1coB8f-00054b-Dw for guile-user@gnu.org; Wed, 15 Mar 2017 11:47:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1coB8c-0007yL-B8 for guile-user@gnu.org; Wed, 15 Mar 2017 11:47:01 -0400 Original-Received: from [195.159.176.226] (port=57007 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1coB8c-0007y1-4t for guile-user@gnu.org; Wed, 15 Mar 2017 11:46:58 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1coB8O-0007NN-AU for guile-user@gnu.org; Wed, 15 Mar 2017 16:46:44 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 24 Original-X-Complaints-To: usenet@blaine.gmane.org X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw Cancel-Lock: sha1:LlmDOLYhG3poZXbpqN8IG3wJiLA= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:13530 Archived-At: Andy Wingo writes: > Hi :) > > On Fri 10 Mar 2017 16:31, David Kastrup writes: > >> a) Guile already uses two different internal representations: basically >> UCS-8 and UCS-32. Adding more internal representations could be done >> using a number of tables indexed by the internal representation type, >> making string representations sort of a "plugin". > > I think we probably want to avoid this if we can. We gain a number of > efficiencies if we can be concrete. Maybe use GOOPS on the string ops by diversifying on string subtypes? One would start by making UCS-32 and UCS-8 string implementations subtypes of strings, then add UTF-8-internal (which is identical to UTF-8 for all-valid UTF-8)? I doubt that this would beat a vector of dedicated hooks but it might look more transparent to implementors with special needs? Maybe not: they might not approach this from a Guile angle of thinking. -- David Kastrup