guile-devel
[Top][All Lists]
Advanced

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

getter with setter from C


From: Dale P. Smith
Subject: getter with setter from C
Date: Mon, 14 May 2001 21:11:27 -0400

While everyone is squeezing in thing before the release, one thing I'd
like to see is a better way to create a setter-with-getter from C. I'm
currently doing this:

#define MAKE_GETTER_SETTER(GETTER, SETTER) \
  scm_sysintern(GETTER, \
                scm_make_procedure_with_setter(gh_lookup(GETTER),\
                                               gh_lookup(SETTER)))

And using it like:

  MAKE_GETTER_SETTER("request-rec:content-type",
"request-rec:set-content-type!");
  MAKE_GETTER_SETTER("request-rec:filename",    
"request-rec:set-filename!");

You have to use SCM's instead of a C functions.

I'd like to see something like:

scm_c_procedure_with_setter("name-goes-here", my_c_getter_func,
my_c_setter_func);

I haven't thought it through, so better minds than mine should think
about it.  I just thought it was so difficult to do from C.

-Dale
-- 
Dale P. Smith
Treasurer, Cleveland Linux Users Group http://cleveland.lug.net
Senior Systems Consultant, Altus Technologies Corporation
address@hidden
440-746-9000 x309



reply via email to

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