[plt-scheme] Recommended style for ncurses ffi?

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Fri Jan 29 13:46:26 EST 2010

Here's a start that I made. It didn't work out for my purposes, so I
stopped, but it may help you.

Jay

On Fri, Jan 29, 2010 at 11:31 AM, Michael Forster <mike at sharedlogic.ca> wrote:
> 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
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>



-- 
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://teammccarthy.org/jay

"The glory of God is Intelligence" - D&C 93
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ncurses.tgz
Type: application/x-gzip
Size: 3454 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20100129/a0fee1a7/attachment.tgz>

Posted on the users mailing list.