From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: proposal: scm_c_public_ref et al Date: Sun, 06 Mar 2011 22:10:48 +0100 Message-ID: References: <874o7g1ake.fsf@netris.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1299445984 1028 80.91.229.12 (6 Mar 2011 21:13:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 6 Mar 2011 21:13:04 +0000 (UTC) Cc: guile-devel To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Mar 06 22:12:58 2011 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.69) (envelope-from ) id 1PwLEj-0000pe-VP for guile-devel@m.gmane.org; Sun, 06 Mar 2011 22:12:58 +0100 Original-Received: from localhost ([127.0.0.1]:55271 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwLEM-0004rW-7m for guile-devel@m.gmane.org; Sun, 06 Mar 2011 16:11:10 -0500 Original-Received: from [140.186.70.92] (port=56373 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwLE3-0004kH-BX for guile-devel@gnu.org; Sun, 06 Mar 2011 16:11:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwLE1-0000Rq-S9 for guile-devel@gnu.org; Sun, 06 Mar 2011 16:10:51 -0500 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:36090 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwLE1-0000Rj-O3 for guile-devel@gnu.org; Sun, 06 Mar 2011 16:10:49 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id E3CDB4B59; Sun, 6 Mar 2011 16:12:14 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=2ykFjPfG5XkBaVu3rJDWUptUboI=; b=m4M/5N d4WeG4BO3g2CvvPtlZWWPW8886doG0GCfBkwX1K6joZ6YidRKyk6699eVcJ/QoEP pE9/Y9itSJiJStgsggtTHppO4abLm1OijMNy+GNoqlMN021P/osxJ7takBWZTfEO Wuu6/EgrMbJ0Xg8MYaNiMsIMsMhY+GApUt7Gs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=mnFDiwvuVIWrYP7ZnsC0GWHccXK7eZxj OlTGkpX4VYol/yel5k6Uv89WpGp35CzXQUnFsJefHMoJ0RpQsQthREL8gWlNcFUT WTWSYfTD6SaF2UiI1Kew7012WBO/XZhAivt9Q4Pqnq6U5FNloT8io5uupLSRxM+S d8liAJbODUY= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id D0EB94B58; Sun, 6 Mar 2011 16:12:13 -0500 (EST) Original-Received: from unquote.localdomain (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 13F274B57; Sun, 6 Mar 2011 16:12:11 -0500 (EST) In-Reply-To: <874o7g1ake.fsf@netris.org> (Mark H. Weaver's message of "Sun, 06 Mar 2011 11:24:33 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: 68679314-4836-11E0-B81B-AF401E47CF6F-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 64.74.157.62 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:11793 Archived-At: On Sun 06 Mar 2011 17:24, Mark H Weaver writes: > Andy Wingo writes: >> SCM scm_c_public_lookup (const char *module_name, const char *name); >> SCM scm_c_private_lookup (const char *module_name, const char *name); >> SCM scm_c_public_ref (const char *module_name, const char *name); >> SCM scm_c_private_ref (const char *module_name, const char *name); >> >> Like the above, but with locale-encoded C strings, for convenience. >> Module names are encoded as for `scm_c_resolve_module'. > > Given that the C strings passed to these functions will more often than > not be embedded in the source code, it seems to me that it's a mistake > assume that they are encoded in the current locale. The current locale > is normally the locale of the user, which may be different from the > locale that the source code is written in. > > Maybe utf8 is a better choice? I thought about this, yes, and you're probably right. However the other scm_c_ functions in modules.h (and other files) use locale encoding. That's probably not something we can change in 2.0.x, and it seemed at the time that consistency was best. (Or can we change them? Does it matter?) If we were to choose a particular encoding to make convenient, I would prefer latin1, because it is common, particularly efficient for Guile (e.g. scm_from_latin1_symbol), and does not raise runtime errors. That does not sacrifice generality, as one can always use scm_from_utf8_symbol or others, and use the SCM-accepting interface. Humm. What do you think about having these procedures take latin1? We can probably cast it as a compatibility-preserving change, with regards to 1.8, which would always treat incoming strings as one byte per char. Andy -- http://wingolog.org/