From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.lisp.guile.devel Subject: Re: mutable interfaces - was: Guile: What's wrong with this? Date: Sat, 07 Jan 2012 18:47:24 +0100 Organization: Organization?!? Message-ID: <87r4zbtnf7.fsf@fencepost.gnu.org> References: <4F027F35.5020001@gmail.com> <1325603029.22166.YahooMailNeo@web37906.mail.mud.yahoo.com> <4F032C41.3070300@gmail.com> <87mxa4ifux.fsf@gnu.org> <4F038BF4.1070200@gnu.org> <87obujzmmc.fsf@Kagami.home> <4F048972.5040803@gnu.org> <87lipnm8yx.fsf@Kagami.home> <4F04D01D.5050801@gnu.org> <8762grf28k.fsf@netris.org> <4F05DC47.1000202@gnu.org> <878vlldb4k.fsf@netris.org> <1325811764.22562.YahooMailNeo@web37903.mail.mud.yahoo.com> <87wr95bo9y.fsf@netris.org> <1325857075.77324.YahooMailNeo@web37903.mail.mud.yahoo.com> <877h14bsx0.fsf@netris.org> <4F074647.1020000@gnu.org> <87ty478p9f.fsf@netris.org> <4F088252.9040000@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1325958467 10212 80.91.229.12 (7 Jan 2012 17:47:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 7 Jan 2012 17:47:47 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Jan 07 18:47:44 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RjaMn-0004Ax-Ja for guile-devel@m.gmane.org; Sat, 07 Jan 2012 18:47:41 +0100 Original-Received: from localhost ([::1]:36813 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RjaMn-00038T-8b for guile-devel@m.gmane.org; Sat, 07 Jan 2012 12:47:41 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:47733) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RjaMl-00038N-Du for guile-devel@gnu.org; Sat, 07 Jan 2012 12:47:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RjaMk-0008RM-9R for guile-devel@gnu.org; Sat, 07 Jan 2012 12:47:39 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:57836) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RjaMj-0008RD-RT for guile-devel@gnu.org; Sat, 07 Jan 2012 12:47:38 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RjaMi-000486-0g for guile-devel@gnu.org; Sat, 07 Jan 2012 18:47:36 +0100 Original-Received: from p508ecc32.dip.t-dialin.net ([80.142.204.50]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 07 Jan 2012 18:47:36 +0100 Original-Received: from dak by p508ecc32.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 07 Jan 2012 18:47:36 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 29 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: p508ecc32.dip.t-dialin.net 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 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) Cancel-Lock: sha1:1Tfz41G05vxiJbVaWQytM1frEII= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:13412 Archived-At: Bruce Korb writes: > On 01/07/12 08:13, Mark H Weaver wrote: >>> Most of the strings that I wind up altering are created with a >>> scm_from_locale_string() C function call. >> >> BTW, beware that scm_from_locale_string() is only appropriate for >> strings that came from the user (e.g. command-line arguments, reading >> from a port, etc). When converting string literals from your own source >> code, you should use scm_from_latin1_string() or scm_from_utf8_string(). >> >> Similarly, to make symbols from C string literals, use >> scm_from_latin1_symbol() or scm_from_utf8_symbol(). >> >> Caveat: these functions did not exist in Guile 1.8. If your C string >> literals are ASCII-only, I guess it won't matter in practice which >> function you use, although it would be good to spread the understanding >> that C string literals should not be interpreted according to the user's >> locale. > > I go back to my argument that a facilitation language needs to focus > on being as helpful as possible. That means doing what is likely > wanted instead of throwing errors at every possibility. It also means > not changing interfaces. Undefined behavior is not an interface. -- David Kastrup