guile-user
[Top][All Lists]
Advanced

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

RE: Naming conventions of conversion routines


From: Daschbach, John L
Subject: RE: Naming conventions of conversion routines
Date: Fri, 06 Jun 2003 10:41:45 -0700

In the face of a changing interface between C and guile it seems that the best 
solution is to write my own conversion API for the routines I need and then 
migrate this to scm* from gh_*.  This however represents another layer which in 
many cases basically copies the gh_* routines.  For example the 
gh_num2doubles() routine, which I use often, wraps calls to scm_* in a loop.  I 
suppose then that if a scm_num2doubles() appears the my_num2doubles() routine 
could be made a macro.  

Because I'm used to it I like the  scm2double <=> double2scm naming convention. 
 I always know that scm is the scheme object.  The current scm_* convention 
does not follow this, using num for an scm number.  It is always clear that scm 
is the scheme side, but looking at code years from now it would not be as 
obvious that num is the scheme object.  Would it be possible to revisit the new 
naming convention?

-John

> ----------
> From:         Marius Vollmer
> 
> 
> "Daschbach, John L" <address@hidden> writes:
> 
> > I have been working to upgrade my guile C code to the new "scm_*"
> > routines from the "gh_*" routines.  The new naming convention is
> > more confusing than the gh convention.  Does anyone else find this
> > so, and should it be changed?
> 
> Yes, yes.  We are not yet ready to replace the gh_ API with an equally
> elegant scm_* API.
> 
> I agree that the conversion routines between C types and Scheme types
> are a very important part of Guile.  They should be complete,
> consistent, easy to use correctly, beautiful on the eyes, etc.
> 
> 
> -- 
> GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405
> 
> 




reply via email to

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