[MLton] OpenGL (currying + library guidelines)

Anoq of the Sun anoq@HardcoreProcessing.com
Wed, 27 Jul 2005 13:04:07 +0200


Mike Thomas wrote:
> Good to hear from you again and especially as I'm lookig forward to seeing
> someone take up the MinGW32 MLton port.

Ok, so I guess my old work on it may not be in vain after all :-)

However, time is running fast this week and reading this mailinglist
takes time, so I may not manage to do it until after SIGGRAPH. But
I should have better chances of finding the time to complete it this
time, since I am not _that_ stressed with other things these days :-)

> One thing I purposely didn't mention in my earlier responses (avoiding more
> work for myself) is that some parts of the OpenGL binding (GL and GLU, but
> not GLUT) do have both curried and uncurried functions exposed, for example:
> 
>        val c_glViewport : int * int * int * int -> unit
>        val glViewport : int -> int -> int -> int -> unit
> 
> where the direct FFI tupled function is simply named with a "c_" prefix.
> 
> I was just pressed for time during the GLUT phase and didn't want to
> encourage anybody to ask for more!

Ok :-) I would still prefer the c_ prefixed one being the curried one and
the one with the "normal" name being the tupled one :-)

But of course it is sad if it breaks a lot of code for you :-( The only
comfort is that the ML-type-system will tell you where to fix it :-)

Search-and-replace in a text editor is good for making this kind of API conversion:

1) "val gl"     -> "val tmp_gl"
2) "val c_gl"   -> "val gl"
3) "val tmp_gl" -> "val c_gl"

:-)


Cheers
-- 
http://www.HardcoreProcessing.com
http://www.anoq.net/music/ - creative instrumental electronic music