June 10, 2008

Naming schemes

I had a first try at substituting the original gl.lisp in cl-sdl with my generated one, and, of course, it failed. So I started taking a look at what differences are left between both, and here is a nasty one: cl-sdl uses an inconsistent naming scheme. Mine, on the other hand, is very strict due to its automated nature. Here is an example: cl-sdl lispifies "glGetIntegerv" into "get-integerv" on the one hand, and "glLoadMatrixd" into "load-matrix-d" on the other hand. My generator script always uses the first variant, and would turn "glLoadMatrixd" into "load-matrixd". This is simply because it doesn't recognise the final "d" as a separate item. I think I'll check the cl-sdl codebase to see if both variants are being actively used. The gl.lisp file seems to favour the second variant (as would I), and so, if the first one is hardly used I can just update those so that the naming scheme becomes uniform. I will then also have to update my script to use this naming scheme, which will require some extra input from the user to figure out where to place the extra dashes... Because of that complication, it might also be worthwhile to just standardise on the first, be it uglier, variant. But if the second variant is more widely used, then I'll have a lot of updating to do... I also need to start thinking on whether the extra work is justified. I still want an up-to-date opengl binding, and using the generation approach still seems a smart thing to do. Having a consistent naming scheme is also a good thing. I just hadn't counted on having to update the use-sites.

No comments: