Andy Wingo <wi...@pobox.com> writes: > Keyword arguments suit this task much better.
Okay, I have a fresh idea for your consideration. Let's provide a more general facility to make keyword arguments more convenient to use from C, while avoiding repeatedly interning them. I propose a new macro SCM_KEYWORD, which would be defined something like this: #ifdef __GNUC__ # define SCM_KEYWORD(name) \ ({ static SCM keyword = SCM_BOOL_F; \ if (SCM_UNLIKELY (scm_is_false (keyword))) \ keyword = scm_from_utf8_keyword (#name); \ return keyword; }) #else # define SCM_KEYWORD(name) scm_from_utf8_keyword (#name) #endif Furthermore, at some point in the future we could provide an optional alternative mechanism, where SCM_KEYWORD would expand into a simple global variable reference, and we'd provide a snarfing script to scan the sources for SCM_KEYWORD and produce an initialization routine for all these global keywords. It might be good to do something similar for looking up and caching scheme procedures as well. What do you think? Mark