[plt-scheme] Recommended style for ncurses ffi?

From: Michael Forster (mike at sharedlogic.ca)
Date: Fri Jan 29 13:31:07 EST 2010

Hi,

I'm writing ncurses ffi bindings for a customer application.  I will
be using much of the ncurses api, including forms and panels.  I might
even write bindings for the cdk, unless I find it sufficient to simply
implement additional widgets in scheme atop the basic bindings.

In any case, I'm hoping that I will have something worth sharing with
the rest of the plt scheme community, perhaps suitable for
distribution via planet.  Thus, I'm more concerned about programming
style than I might be otherwise.  I've had a look through some of the
examples under the ffi collection, and I see some function and type
names imported verbatim.  For example, from magick.ss,

    (defmagick DestroyMagickWand ...
    (define _PixelIterator (make-ctype ...

In xmmsctrl.ss, I see reformatting of names to replace underscores with dashes,

    (defxmms get-playlist-pos ...
    (defxmms set-playlist-pos ...

In xsod.ss, I see prefixed names, but that's carried over from the foreign api,

    (defxosd* xosd-set-timeout ...

In none of the examples have I seen use of, say, the '!' suffix for
mutating functions.

So, since I'm making the effort to write a quality set of ncurses
bindings, what do folks here recommend?  Verbatim import of names?
Rerformatting (including prefixing and suffixing) of names to make
them more scheme-like?


Thanks,

Mike


Posted on the users mailing list.