unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Thien-Thi Nguyen <ttn@gnuvola.org>
To: guile-devel <guile-devel@gnu.org>
Subject: Re: proposal: scm_c_public_ref et al
Date: Sun, 06 Mar 2011 18:10:47 +0100	[thread overview]
Message-ID: <87tyfgw4x4.fsf@ambire.localdomain> (raw)
In-Reply-To: <874o7g1ake.fsf@netris.org> (Mark H. Weaver's message of "Sun, 06 Mar 2011 11:24:33 -0500")

() Mark H Weaver <mhw@netris.org>
() 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 => (ice-9 q) */
     "make-q", "enq!", "deq!", NULL,
     "common-list", /* leaf => (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 ‘actual_scheme_objects’ or another object vector.

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.



  reply	other threads:[~2011-03-06 17:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-06 11:24 proposal: scm_c_public_ref et al Andy Wingo
2011-03-06 16:24 ` Mark H Weaver
2011-03-06 17:10   ` Thien-Thi Nguyen [this message]
2011-03-06 21:34     ` Andy Wingo
2011-03-06 21:10   ` Andy Wingo
2011-03-06 22:22 ` Ludovic Courtès
2011-03-07 10:45   ` Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tyfgw4x4.fsf@ambire.localdomain \
    --to=ttn@gnuvola.org \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).