This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: scm_bits_t


On 14 Mar 2000, Mikael Djurfeldt wrote:

> Dirk Herrmann <dirk@ida.ing.tu-bs.de> writes:
> 
> > I suggest to use scm_t instead of scm_bits_t for guile's low leve data
> > type.
> 
> Why?
> 
> To me, scm_bits_t seems like a better name than scm_t.  Note that the
> first part of the name is just a prefix, so `scm_t' conceptually is
> just "t".

C programmers expect foo_t to denote a foo type, like time_t or
size_t.  And, since scm_bits_t actually _is_ the basic scheme type, I
think the name scm_t fits quite well.

Further, most other identifiers that lie in the scm_ namespace are further
categorized into sub-namespaces (scm_tc_, scm_char_ etc. or SCM_BOOL_,
SCM_IM_ ...), thus it is surprising that especially the symbol 't, which
only has an indirect relationship to scheme, should be of such importance
that it occupies this identifier.  Isn't it ridiculous that scheme's #t
has to be written as SCM_BOOL_T, while scm_t is reserved for lisp's 't?  I
think that a name like scm_lisp_true or something would fit better for 't,
but I'm no lisp expert.  Futher:  is this definition used at all?

> scm_bits_t actually tells what it is about: We convert an atomic type,
> SCM, into a bit representation.

The fact, that guile encodes everyting in a fairly complicated (but
effecive) bit structure is true.  But I don't think it is necessary to
emphasize this fact.  Further, as I said in my previous mail, there are
other values which are put into scm_bits_t variables that are just plain
C values, without any special bit-level encoding.  If a users develops a
smob type, the cdr of the cell can hold an arbitrary value.  It can also
be a SCM value, but it's up to the designer of the smob type what to put
in there.  The only thing that has to be guaranteed is that it fits into a
variable of type scm_bits_t.

Obviously, this is all a matter of taste.  Thus I assume that others also
have their opinions.  The point is, that we can _now_ select a name that
will be convenient to use in C code for the guile community as well as
newcomers to guile.  And I would prefer scm_t.

Best regards
Dirk Herrmann


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]