[resend to guile-user, first copy went to bug-guile]
For use from a Fortran program I am collecting API fixes for libguile.so
as wrapper functions for what is provided to C-programs as macros.
I noted that some of the macros are function-macros some are symbol
macros. An example of the latter is
#define scm_to_int scm_to_int23
This is inconsistent and makes escaping such macros slightly more difficult.
(Honestly I dont know a way yet).
One guile developer on IRC said this is "probably a good thing to fix"
so I report
it here. I dont build Guile 2 myself as the installations I use are quite
As a background, Fortran allows you to declare "foreign" functions, for example,
type, public, bind(c) :: scm_t
integer(c_intptr_t) :: do_not_ever_use
end type scm_t
function scm_symbol_p (obj) result (yes) bind (c)
type(scm_t), intent(in), value :: obj
type(scm_t) :: yes
end function scm_symbol_p
This makes use of library functions quite handy. But it does not provide a
way to access a C-macro, naturally.
SCM guile_macro_scm_from_int (int i);
int guile_macro_scm_to_int (SCM obj);
int (scm_is_true) (SCM obj);
int (scm_is_symbol) (SCM obj);
int (scm_is_null) (SCM obj);
SCM (scm_eol) (void);