guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: proposal: scm_c_public_ref et al


From: Thien-Thi Nguyen
Subject: Re: proposal: scm_c_public_ref et al
Date: Sun, 06 Mar 2011 18:10:47 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

() Mark H Weaver <address@hidden>
() 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 via email to

[Prev in Thread] Current Thread [Next in Thread]