From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.lisp.guile.devel Subject: Re: proposal: scm_c_public_ref et al Date: Sun, 06 Mar 2011 18:10:47 +0100 Message-ID: <87tyfgw4x4.fsf@ambire.localdomain> References: <874o7g1ake.fsf@netris.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: dough.gmane.org 1299431854 30962 80.91.229.12 (6 Mar 2011 17:17:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 6 Mar 2011 17:17:34 +0000 (UTC) To: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Mar 06 18:17:29 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 1PwHaB-0000ZN-TN for guile-devel@m.gmane.org; Sun, 06 Mar 2011 18:17:28 +0100 Original-Received: from localhost ([127.0.0.1]:59839 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwHaB-0008Iw-AI for guile-devel@m.gmane.org; Sun, 06 Mar 2011 12:17:27 -0500 Original-Received: from [140.186.70.92] (port=48701 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwHZx-0008FP-1p for guile-devel@gnu.org; Sun, 06 Mar 2011 12:17:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwHZv-0007EG-Lt for guile-devel@gnu.org; Sun, 06 Mar 2011 12:17:12 -0500 Original-Received: from smtp205.alice.it ([82.57.200.101]:53183) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwHZv-0007E5-9A for guile-devel@gnu.org; Sun, 06 Mar 2011 12:17:11 -0500 Original-Received: from ambire.localdomain (82.48.1.146) by smtp205.alice.it (8.5.124.08) id 4D0D003806A4C57D for guile-devel@gnu.org; Sun, 6 Mar 2011 18:17:08 +0100 Original-Received: from ttn by ambire.localdomain with local (Exim 4.69) (envelope-from ) id 1PwHTk-0002xT-BW for guile-devel@gnu.org; Sun, 06 Mar 2011 18:10:48 +0100 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/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 82.57.200.101 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:11791 Archived-At: () Mark H Weaver () Sun, 06 Mar 2011 11:24:33 -0500 Maybe utf8 is a better choice? A module name is a list of symbols, so why not use that from the beginning? If the process of converting "ice-9 common-list" into (ice-9 common-list) must happen somewhere, it would be nice if it could happen earlier, to perhaps amortize over similarly-prefixed (ice-9 foo) names. This suggests the interface should be at a higher abstraction level, specifying the module name prefix (possibly empty list of symbols) and the list of module name leaf symbols. This kind of interaction maps well to real life use, where client code knows a priori which of the many modules in a family are required. The more closer to declarative the interface the better. Ideally, in C i would be able to specify: - prefix "(ice-9)" - list of requested elements { "q", /* leaf =3D> (ice-9 q) */ "make-q", "enq!", "deq!", NULL, "common-list", /* leaf =3D> (ice-9 common-list) */ "uniq", NULL }; - vector to write them to SCM actual_scheme_objects[6]; Of course, i would need to add some sugar: #define MOD_Q actual_scheme_objects[0] #define MAKE_Q actual_scheme_objects[1] #define ENQ_X actual_scheme_objects[2] #define DEQ_X actual_scheme_objects[3] #edfine MOD_CL actual_scheme_objects[4] #define UNIQ actual_scheme_objects[5] to make things easier on the eyes. The MOD_foo objects might be useful later to pass to "individual referencing" funcs (i.e., Andy's proposal). If there are other prefixes, e.g., (database a) through (database z), these could use =E2=80=98actual_scheme_objects=E2=80=99 or another object v= ector. Generally, mass-referencing is more efficient and easier to maintain than individual referencing primitives. BTW, i agree that all C strings should be explicitly specified as UTF-8.