You can find in the r.h header file an outcommented framework for the "neural" function. That can be used as a template that should work for most machine learning algorithms.

And yes, I'll definitely post a tutorial. In fact I would have done this already some time ago, but some other tasks intervened.